Skip to content

Commit be95911

Browse files
docs(api/hooks/useNavigate): add some extra reference links (#14170)
1 parent 3d1cfe4 commit be95911

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

packages/react-router/lib/hooks.tsx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -324,12 +324,13 @@ function useIsomorphicLayoutEffect(
324324
* Declarative mode versus Data/Framework mode - the primary difference being
325325
* that the latter is able to return a stable reference that does not change
326326
* identity across navigations. The implementation in Data/Framework mode also
327-
* returns a `Promise` that resolves when the navigation is completed. This means
328-
* the return type of `useNavigate` is `void | Promise<void>`. This is accurate,
329-
* but can lead to some red squigglies based on the union in the return value:
327+
* returns a [`Promise`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)
328+
* that resolves when the navigation is completed. This means the return type of
329+
* `useNavigate` is `void | Promise<void>`. This is accurate, but can lead to
330+
* some red squigglies based on the union in the return value:
330331
*
331332
* - If you're using `typescript-eslint`, you may see errors from
332-
* [`@typescript-eslint/no-floating-promises`](https://typescript-eslint.io/rules/no-floating-promises/)
333+
* [`@typescript-eslint/no-floating-promises`](https://typescript-eslint.io/rules/no-floating-promises)
333334
* - In Framework/Data mode, `React.use(navigate())` will show a false-positive
334335
* `Argument of type 'void | Promise<void>' is not assignable to parameter of
335336
* type 'Usable<void>'` error

0 commit comments

Comments
 (0)