D
D
Daniil2018-06-29 10:03:08
React
Daniil, 2018-06-29 10:03:08

What are the options with NotFound Page in React Router?

https://codesandbox.io/s/13y6ykwnkl
Good morning. I'm a bit confused about how to correctly "force" NotFound to render in my case (or in general). After all, we have /: user - the user's url will always match and "interfere" with NotFound, in which direction to dig or maybe give an example? You are welcome)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Anton Spirin, 2018-06-29
@TchernyavskD

Can be handled in an asynchronous activity or in a user component. If the server returned a 404 instead of a user and a message like 'ApiObjectNotFound', redirect to the NotFound page.
Don't forget to make a list of reserved words that can't be used for the user's slug.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question