I'm trying to display CollectionPage Component from ShopPage component as a nested route that receives collectionId as a param but I get an empty page. These are my components.
Shop Page :
import React from 'react';
import CollectionsOverview from '../../components/collections-overview/collections-overview.component';
import { Route } from 'react-router-dom'
import CollectionPage from '../collection/collection.component';
const ShopPage = ({ match }) => (
<div className='shop-page'>
< Route exact path={`${match.path}`} component={CollectionsOverview} />
<Route exact path={`${match.path}/collectionId`} component={CollectionPage} />
</div>
)
export default ShopPage;
CollectionPage Component :
import React from 'react';
import CollectionItem from '../../components/collection-item/collection-item.component';
import './collection.styles.scss';
const CollectionPage=({match})=>{
console.log(match);
return(
<div className="collection-page">
<h2>Collection Page</h2>
</div>
)}
export default CollectionPage;