I'm creating an app with react v18 & react-router-dom v6.4.1 where I'm using the createBrowserRouter
function as they show in the docs (
CodePudding user response:
I've just tried this in my PC
You should declare this in a .tsx file.
It doesn't work in a .ts file.
I hope this works for you