I'm very confused with the change of usage of react-router-dom v6. By their documentation, we can simply pass our Route component inside the element prop, but I am getting this error
Uncaught TypeError: meta.relativePath.startsWith is not a function
and I couldn't find any solutions.
import React from 'react';
import { Routes, Route, Navigate } from "react-router-dom";
import { Results } from './Results';
export const Catogories = () => {
return (
<div className='p-4'>
<Routes>
<Route exact path='/' element={<Navigate to='/search' />} />
<Route exact path={["/search", '/images,', '/news', '/videos']} element={<Results />} />
</Routes>
</div>
);
};