const App = () => {
return (
<div>
<Router>
<Layout>
<Switch>
<Route exact path="/movies/:movieId" component={DetailMoviePage} />
</Switch>
</Layout>
</Router>
</div>
);
};
export default App;
const testClick = (dataId)=> {
console.log(dataId);
history.push({
pathname: `/movies/${dataId}`,
state: dataId,
});
}
return (
...
{movies.length > 0 &&
movies.map((movie) => (
<Card style={{ margin: "20px", board: "none" }}
onClick={() => testClick(data.id)}
>
...
);
};