Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: Clarify documentation about the overrideExisting flag in injectEndpoints #2696

Merged
merged 1 commit into from
Sep 14, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.
:::