I am testing on React, and I want to see the detail of a page and I need to pass a param in the path, so I was searching and I need to wrap my component in a MemoryRouter and a Route, but I still getting an error:
MemoryRouter:
component = render(
<Provider store={store}>
<MemoryRouter initialEntries={['/characters/1009368']}>
<Route path="characters/:id">
<CharacterDetail />
</Route>
</MemoryRouter>
</Provider>,
);
And this is the error that I got:
console.error
Error: Uncaught [Error: A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.]
What can I do?