P
P
Pumba88972021-01-04 12:52:34
JavaScript
Pumba8897, 2021-01-04 12:52:34

How to refactor React conditional rendering with lots of ifs?

Hello!
There is a small React application (step by step form). Steps lie on different urls. And for recovery after a reboot, as well as for processing additional logic (for example, redirecting the user to the desired step if he did not upload the document), a fairly large number of conditions were written, including nested ones. For obvious reasons, this does not look very personal. How can you more conveniently rewrite all this "good"? Maybe someone came across. What if all this logic is moved to react-router-redux or redux-saga-router ?
Thanks in advance!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
L
Leonid Yakovlev, 2021-01-04
@deleo547

Yes
Or you not such answer expected without code examples?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question