react-router V4 & DvaJS : by @solodynamo
What is react-router?
- Router for React which keeps your UI in sync with the URL.
Features
- Lazy code loading
- Dynamic route matching
- Dynamic route matching
Version 3 vs Version 4
- v4 is almost complete rewrite of react-router
- Reason: Declarative Components
- Declarative:Answers What You Wanna Do ?
- So we write our router code as if they were just normal React components.Lets see...
- We treat each component just as another react UI component.
- "exact" attribute in the first is to prevent Home component to render together with About or Contact component again.
- We can further break it down ...PTO
DvaJS
- Dva is a lightweight based on react, redux which aims to make building React/Redux applications easier and better.
Why Use It?
- Less Messy Code.
- Works with react-native too.
- Very Small API.