I have read this in the documentation but I am not sure what the difference between BrowserRouter
and createBrowserRouter
.
This is what it says in docs:
createBrowserRouter:
This is the recommended router for all React Router web projects. It uses the DOM History API to update the URL and manage the history stack.
It also enables the v6.4 data APIs like loaders, actions, fetchers and more.
BrowserRouter:
A
<BrowserRouter>
stores the current location in the browser's address bar using clean URLs and navigates using the browser's built-in history stack.
My second question is:
Can I use createBrowserRouter
without adding data APIs like loaders, actions etc. The reason is I am not sure how to use data APIs with Redux Toolkit Query and I found limited sources. I could perhaps add loaders later.