Here is the my route code:
<Switch>{createRoutes()}</Switch>
const createRoutes = () =>
Routes.map(({ component: Component, urls }) =>
urls.map((url) => (
<Route
path={url}
exact
render={() => <Component/>}
/>
)),
);
const Routes = [
{
urls: ['/'],
component: Home,
},
{
urls: ['/test'],
component: Test,
},
];
And what I want is, when url is '/test?x=1' match component Test, and when url is '/test' will match component Home. How can I be able to do this?