0

In my React project, the routing is performed by React Router. The thing is when this is supposed to handle different routes, the 404.html shows up instead. For my specific case

<BrowserRouter>
            <Routes>
                <Route path="/" element={user ? <Home /> : <SignIn />} />
                <Route
                    path="/upload"
                    element={user ? <Upload /> : <SignIn />}
                />
                <Route path="/chat" element={user ? <Chat /> : <SignIn />} />
                <Route
                    path="/settings"
                    element={user ? <Settings /> : <SignIn />}
                />
            </Routes>
</BrowserRouter>

The following is how I am handling Routes. It works on localhost but it doesn't work after Netlify build deploy.

Please do look at this link

If you want to look at the entire code, you can find it here

The Home page works fine, but the chat, settings and upload routes are being blocked by some cause.

2

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.