Releases: dlmr/react-router-redial
Releases · dlmr/react-router-redial
v0.3.6
v0.3.5
v0.3.4
v0.3.3
v0.3.2
v0.3.1
v0.3.0
Breaking
- Rewritten as a React Router middleware — #5 by @PAkerstrand
-import { RedialContext } from 'react-router-redial';
+import { useRedial } from 'react-router-redial';
+import { applyRouterMiddleware } from 'react-router';
<Router
history={ browserHistory }
routes={ routes }
- render={ (props) => (
- <RedialContext
- { ...props }
- locals={ locals }
- blocking={ ['fetch'] }
- defer={ ['defer', 'done' ] }
- parallel={ true }
- initialLoading={ () => <div>Loading…</div> }
- />
+ render={ applyRouterMiddleware(
+ useRedial({
+ locals,
+ beforeTransition: ['fetch'],
+ afterTransition: ['defer', 'done'],
+ parallel: true,
+ initialLoading: () => <div>Loading…</div>,
+ })
)}
/>
- Renamed and updated parts of the client API to make more sense — #7
deferredLoading => afterTransitionLoading
blocking => beforeTransition
defer => afterTransition
Features
- Updated peerDependency to allow the latest version of
[email protected]
— #8 - Added more data to the lifecycle functions — #7
onError(error, metaData)
onAborted(becauseError)
onCompleted(type)
v0.2.3
v0.2.2
Features
- Better support for aborting redial hooks and detecting of it has been aborted.
isAborted()
- Function for manually abort redial hooks.
abort()
- Lifecycle functions, see below.
onStarted(force) Invoked when a route transition has been detected and when redial hooks will be invoked
onError(error, type) Invoked when an error happens, type can be either a "location-change", "aborted" or "other" reason
onAborted Invoked if it was prematurely aborted through manual interaction
onCompleted Invoked if everything was completed successfully, both blocking and deferred
Fixes
- Inconstancy when using force together with parallel set to false.