B
B
bitalikr19992019-08-29 10:07:18
React
bitalikr1999, 2019-08-29 10:07:18

What's wrong with react router?

I have a simple route

<React.Fragment>
        <Route path="/public" component={PublicComponent}></Route>
</React.Fragment>

and in the component i have another route
//Public component
<React.Fragment>

            <Route exact path="/public/login" component={LoginComponent}></Route>

        </React.Fragment>

by the link /public I see my component, everything is ok, but if I try to go to /public/login, nothing loads at all

Answer the question

In order to leave comments, you need to log in

1 answer(s)
B
bitalikr1999, 2019-08-29
@bitalikr1999

Solution: The
problem was with browserrouter
I added publicPath: '/' to output in webpack.config.js and that solved the problem

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question