Add a home/landing page to my app
At the moment I have a logingPage added where the user can logging in and see the dashboard, I would Like to add a home page to it where I will do a landing page. How can I achieve that?
3 Replies
Hi @acidias. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
----------------------
To add a home page as a landing page, you can follow these steps:
1. First, wrap your
<Refine>
component inside the <BrowserRouter>
component from react-router-dom
.
2. Then, define a new route for your home page (landing page) using the <Route>
component from react-router-dom
. You can create a new component for your landing page, let's call it LandingPage
.
Here's an example of how your updated code should look like:
In this example, we've added a new route for the
LandingPage
component at the root path ("/"). The <Refine>
component is now wrapped inside a <Route>
with a path of "*"
which means it will match all other routes except the root path.
Don't forget to create your LandingPage
component and import it in your App
component.
For more information on handling routes in refine, you can refer to this extract: React Router v6 - FAQ (https://refine.dev/docs/packages/documentation/routers/react-router-v6#faq)
----------------------
Note: you can ask me a follow up question by @ mentioning me again
:speech_balloon:
----------------------React Router v6 | refine
refine provides router bindings and utilities for React Router v6. It is built on top of the react-router-dom package. This package will provide easy integration between refine and react-router-dom for both existing projects and new projects.
<@134090892167479296> kapa.ai is still learning and improving, please let us how it did by reacting below