PROBLEM:-
"Too much coupling of conditional rendering and single level component structure makes it harder for effective flow and leads to inconsistencies."
SOLUTION:-
- Rather than having all routing logic coupled inside App.js, Decoupling should be done by separating pages as two components:
- <LoggedInRoute />
- <LoggedOutRoute />
- Flow should first be determined using loggedIn state, and then verified etc. This will make it easier to map first priority validation.
- This will also make it easier to segregate any unnecessary state and API calls in case of non logged in user.
PROBLEM:-
"Too much coupling of conditional rendering and single level component structure makes it harder for effective flow and leads to inconsistencies."
SOLUTION:-