4Catalyzer / found

Extensible route-based routing for React applications
https://4catalyzer.github.io/found/
MIT License
794 stars 55 forks source link

Routing improper behavior when back button is pressed #986

Open pkrakesh opened 2 years ago

pkrakesh commented 2 years ago

I am using found in my application like this:

const Router = createFarceRouter({
    historyProtocol: new BrowserProtocol(),
    historyMiddlewares: [queryMiddleware],
    routeConfig: makeRouteConfig(
        <Route path="/">

            <Route Component={App} />

            <Route path="/login">
                <Route Component={LoginPage} />
            </Route>

            <Route path="/signup">
                <Route Component={SignupPage} />
            </Route>

            <Route path="/home">
                <Route Component={HomeViewWrapper} />
                <Route path="add-source" Component={AddSourcePageContainer} />
            </Route>

        </Route>
    ),

It works correctly when pressing back and forward button for /login and /signup from / but, when pressing browser back button from /home/add-source page, the application exits instead of going back to /home. What is the correct implementation of the routing? Kindly help.