Apply suggestions from code review
Co-authored-by: Fredrik Adelöw <freben@gmail.com>
This commit is contained in:
@@ -321,7 +321,7 @@ app, allowing it to be used as a switch for whether a particular link should be
|
||||
displayed or action should be taken.
|
||||
|
||||
When calling `useRouteRef` with an optional external route, its return signature
|
||||
is change to `RouteFunc | undefined`, allowing for logic like this:
|
||||
is changed to `RouteFunc | undefined`, allowing for logic like this:
|
||||
|
||||
```tsx
|
||||
const MyComponent = () => {
|
||||
|
||||
@@ -96,7 +96,7 @@ type ExtractKeysWithType<Obj extends { [key in string]: any }, Type> = {
|
||||
}[keyof Obj];
|
||||
|
||||
/**
|
||||
* Given a map of boolean values denoting whether a rout is optional, create a
|
||||
* Given a map of boolean values denoting whether a route is optional, create a
|
||||
* map of needed RouteRefs.
|
||||
*
|
||||
* For example { foo: false, bar: true } gives { foo: RouteRef<any>, bar?: RouteRef<any> }
|
||||
|
||||
@@ -83,7 +83,7 @@ export type ExternalRouteRefOptions<Optional extends boolean = false> = {
|
||||
* Whether or not this route is optional, defaults to false.
|
||||
*
|
||||
* Optional external routes are not required to be bound in the app, and
|
||||
* if aren't, `useRouteRef` will return `undefined`.
|
||||
* if they aren't, `useRouteRef` will return `undefined`.
|
||||
*/
|
||||
optional?: Optional;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user