Open Robin-Lord opened 2 years ago
//App.js
//productScreen page
import React from 'react'; import data from '../data' import Rating from '../component/Rating' import { Link } from "react-router-dom"
export default function ProductScreen (props) { console.log(props.match.params.id) const product = data.products.find((x) => x._id === props.match.params); console.log(product); if (!product) { return
//the console in the web browser
matched leaf route at location "/product/1" does not have an element. This means it will render an
pls wat is the solution. pls urgent ans
Hi there, I've been trying to follow along with your blog post using this code but when I do I get the error saying that the matched leaf at each of my WordPress routes doesn't have an element. I've tried changing "render" to "element" like this
element={props => (<ExamplePage {...props} page={page} />)}
but no luck. I've searched around but all of the debug recommendations are just that - make sure there is an "element" declared. Any help would be massively appreciated.
Thanks