You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-`parseQuery`、`stringifyQuery` Provide custom query string parse / stringify functions, can be override by `new ReactViewRouter({ parseQuery: parseQueryMethod, stringifyQuery: stringifyQueryMethod });`
265
265
266
+
### Export Methods
267
+
-`useRouteGuards` route component guards methods:
268
+
```javascript
269
+
/**
270
+
* route component guards methods
271
+
* @param{Object}component - route component
272
+
* @param{Object}guards - guards methods
273
+
* @param{Class}[componentClass] - the route component class, it will be useful when component is High-order components
274
+
* @return{RouteComponentGuards} - the route componet that can be regarded as `React.forwardRef`
275
+
* /
276
+
function useRouteGuards(component, guards = {}, componentClass) {}
otherwise, webpack will package both `history` and `history-fix` into the target js file.
281
338
282
-
2.when route component is `Class Component` (not `Function Component`), the`this` in `afterRouteEnter`, `beforeRouteUpdate`,`beforeRouteLeave`,`afterRouteLeave` Component Guards and `afterEnter`,`beforeUpdate`,`beforeLeave`,`afterLeave` in Route Guards will be the component instance;
339
+
2. if route component is `Class Component` (not `Function Component`), then `this` variable in `afterRouteEnter`, `beforeRouteUpdate`,`beforeRouteLeave`,`afterRouteLeave` Component Guards and `afterEnter`,`beforeUpdate`,`beforeLeave`,`afterLeave` in Route Guards will be that component instance;
0 commit comments