File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -141,12 +141,13 @@ Internally, `useNavigate` uses a separate implementation when you are in
141
141
Declarative mode versus Data/Framework mode - the primary difference being
142
142
that the latter is able to return a stable reference that does not change
143
143
identity across navigations. The implementation in Data/Framework mode also
144
- returns a ` Promise ` that resolves when the navigation is completed. This means
145
- the return type of ` useNavigate ` is ` void | Promise <void >` . This is accurate,
146
- but can lead to some red squigglies based on the union in the return value:
144
+ returns a [ ` Promise ` ](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)
145
+ that resolves when the navigation is completed. This means the return type of
146
+ ` useNavigate ` is ` void | Promise <void >` . This is accurate, but can lead to
147
+ some red squigglies based on the union in the return value:
147
148
148
149
- If you're using ` typescript - eslint ` , you may see errors from
149
- [ ` @typescript - eslint / no - floating - promises ` ](https://typescript-eslint.io/rules/no-floating-promises/ )
150
+ [ ` @typescript - eslint / no - floating - promises ` ](https://typescript-eslint.io/rules/no-floating-promises)
150
151
- In Framework/Data mode, ` React .use (navigate ())` will show a false-positive
151
152
` Argument of type ' void | Promise<void>' is not assignable to parameter of
152
153
type ' Usable<void>' ` error
You can’t perform that action at this time.
0 commit comments