4 ms·
In my system, the data and routes aren't coupled. Here's the flow: - ReactRouter figures out which routes are being rendered. It yields routerState, which in
by bsimpson 12y ago
In my system, the data and routes aren't coupled. Here's the flow:
- ReactRouter figures out which routes are being rendered. It yields routerState, which includes a dictionary of all the active parameter names and their values.
- The actionsForRouterState dictionary declares which actions and stores are correlated with a particular route or parameter name.
- callActionsForRouterState filters actionsForRouterState to include only the actions that are relevant for the routes and parameter names dictated in routerState.
- It calls these actions, returning a promise that resolves when all their stores are filled.
- After that promise resolves, it's safe to call React.render. Any calls from the active components to Store.listen will be resolved with the prepared data during mounting (e.g. immediately before the render pass).
Is that helpful?