Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Completed Dynamic Product Details Page exercise #7

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

MoniqueC10-4
Copy link

Installed react-router-dom

Correctly imported useParams, BrowserRouter and productsData

Built the ProductList component using products.json as the source of the data without converting it into an array

Set up dynamic routes for the clickable product name in ProductList (<Link to={/products/${productId}}>{product.name}) and for individual products (<Route path='/products/:productId' element={} />) to show the product details

Built the ProductDetail component using the useParams hook (let { productId } = useParams();) to extract the productId from the URL, retrieve (const product = productsData.products[productId];) and display (

{product.name}

, etc) the details of the product

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant