I am creating PWA application that will be downloaded into users phones (primarily used as downloaded version). I am wondering if I am creating some multi-step screens content (in our example creating some activity: 1. step: - adding name , 2. step - adding time, ...) what is the best way to handle it from React side? Is it better to navigate via router between each step or simply just control the screens based on the state.
I can see pros and cons in both approaches for example using router:
- when user enters route into web browser for step number 3 that he won't be allowed to enter yet - what to do?
- immune to refresh because refresh is based on the current route so content remains the same
For state :
- when user refreshes the screen he will loose all the data (which is expected in SPA) and is redirected on the beginning of this flow
I also think this is strongly dependent on how the backend is designed (if the data is passed for every step or if only final merged data is send to backend)