I want to insert via URL some data like an ID.
Example: somewebsite.com/movie/(ID_GOES_HERE)
But i can't understand how to make it happen. I want the data to go in the url and i want to retrieve it in movie.js, how do i do that?
I installed router dom in the app.
import React from 'react';
import ReactDOM from 'react-dom';
import {Router, Switch, Route} from 'react-router-dom';
import createBrowserHistory from 'history/createBrowserHistory';
import App from './App';
import MovieDetail from './Movie';
const history = createBrowserHistory();
ReactDOM.render(
<Router history={history}>
<Switch>
<Route exact path='/' component={App}/>
<Route path='/movie' component={Movie}/>
</Switch>
</Router>,
document.getElementById('root')
);
It is expected to show the ID in Movie.