Link not functioning on existing pages #13200
-
Next 9.3
Should go to the page located in /pages/products.js but it does not. The url appears to change to localhost:3000/products but nothing gets loaded. When testing with this:
It gives 404 because testMe does not exist. It appears when the page does exist that it's not routing to that page. When I manually go to the browser url and input localhost:3000/products it does load the page. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
Could you provide a repository that reproduces this? I wasn't able to reproduce with the steps you outlined. |
Beta Was this translation helpful? Give feedback.
-
Inside your const [children, setChildren] = useState(props.children); which will not work. You need to instead just do: const Layout = props => {
return (
<div>
<Header />
{props.children}
</div>
)
}
export default Layout; |
Beta Was this translation helpful? Give feedback.
Inside your
components/Layout.js
file you have:which will not work.
You need to instead just do: