Skip to content

Commit

Permalink
Merge pull request #2696 from PauloRSF/clarify-overrideexisting-docs
Browse files Browse the repository at this point in the history
  • Loading branch information
markerikson authored Sep 14, 2022
2 parents 3de00f4 + 2abbe74 commit 7c3129c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion docs/rtk-query/api/created-api/code-splitting.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ Accepts an options object containing the same `endpoints` builder callback you w

Returns an updated and enhanced version of the API slice object, containing the combined endpoint definitions.

The `overrideExisting` flag controls a development-only warning that notifies you if there is a name clash between endpoint definitions. When set to `true`, the warning will not be printed.
In development, endpoints will not be overridden unless `overrideExisting` is set to `true`. If not, a warning will be shown to notify you if there is a name clash between endpoint definitions.

This method is primarily useful for code splitting and hot reloading.

Expand Down
2 changes: 1 addition & 1 deletion docs/rtk-query/usage/code-splitting.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -56,5 +56,5 @@ export const { useExampleQuery } = extendedApi
```

:::tip
You will get a warning if you inject an endpoint that already exists in development mode when you don't explicitly specify `overrideExisting: true`. You **will not see this in production** and the existing endpoint will just be overriden, so make sure to account for this in your tests.
In development mode, if you inject an endpoint that already exists and don't explicitly specify `overrideExisting: true`, the endpoint will not be overridden and you will get a warning about it. You **will not see the warning in production** and the existing endpoint will just be overriden, so make sure to account for this in your tests.
:::

0 comments on commit 7c3129c

Please sign in to comment.