A
A
alex4answ2020-04-17 06:21:01
React
alex4answ, 2020-04-17 06:21:01

Multipage on yii2 + reactJs?

There is a yii2 backend that generates html itself, an ordinary old site - site.ru
It has a rest api - api.site.ru

For the sake of practice, I want to transfer site.ru completely to react, but in some places I don’t understand how to build the work, namely:

1 I have to give the same statics with one bundle from any site.ru page, and use react-router for multipage, right?

2. How to handle 404 ?
- I understand that react-router has the ability to catch all "routes not specified", but what if my fetch request returned 404 ?
Do I understand correctly that this is solved - by throwing an exception, and by react to catch it?

thanks for the help

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question