Skip to content

Commit deb9e82

Browse files
committed
Update import paths
1 parent 1fbf250 commit deb9e82

File tree

9 files changed

+37
-29
lines changed

9 files changed

+37
-29
lines changed

docs/api/rtk-query/ApiProvider.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ hide_title: true
1212
[examples](docblock://query/react/ApiProvider.tsx?token=ApiProvider)
1313

1414
:::danger
15-
Using this together with an existing redux store will cause them to conflict with each other. If you are already using Redux, please use follow the instructions as shown in the [Getting Started guide](../introduction/getting-started).
15+
Using this together with an existing Redux store will cause them to conflict with each other. If you are already using Redux, please use follow the instructions as shown in the [Getting Started guide](../../introduction/getting-started).
1616
:::
1717

1818
### Example

docs/api/rtk-query/created-api/endpoints.md

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -112,12 +112,6 @@ A function that accepts a cache key argument, and generates a new memoized selec
112112

113113
RTKQ defines a `Symbol` named `skipSelector` internally. If `skipSelector` is passed as the query argument to these selectors, the selector will return `undefined`. This can be used to avoid returning a value if a given query is supposed to be disabled.
114114

115-
:::caution
116-
117-
RTKQ does not currently export `skipSelector`, although the React hooks use it internally. We plan to export it before final release so that end users can use that as well - see https://github.com/rtk-incubator/rtk-query/issues/211 .
118-
119-
:::
120-
121115
React Hooks users will most likely never need to use these directly, as the hooks automatically use these selectors as needed.
122116

123117
:::caution

docs/api/rtk-query/created-api/hooks.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ The core RTK Query `createApi` method is UI-agnostic, in the same way that the R
1414
However, RTK Query also provides the ability to auto-generate React hooks for each of your endpoints. Since this specifically depends on React itself, RTK Query provides an alternate entry point that exposes a customized version of `createApi` that includes that functionality:
1515

1616
```js
17-
import { createApi } from '@rtk-incubator/rtk-query/react';
17+
import { createApi } from 'reduxjs/toolkit/query/react'
1818
```
1919

2020
If you have used the React-specific version of `createApi`, the generated `Api` slice structure will also contain a set of React hooks. These endpoint hooks are available as `api.endpoints[endpointName].useQuery` or `api.endpoints[endpointName].useMutation`, matching how you defined that endpoint.

docs/api/rtk-query/fetchBaseQuery.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ Promise<{
4343
To use it, import it when you are [creating an API service definition](../introduction/getting-started#create-an-api-service).
4444

4545
```ts title="src/services/pokemon.ts"
46-
// Or from '@rtk-incubator/rtk-query/react'
47-
import { createApi, fetchBaseQuery } from '@rtk-incubator/rtk-query';
46+
// Or from '@reduxjs/toolkit/query/react'
47+
import { createApi, fetchBaseQuery } from '@reduxjs/toolkit/query'
4848
4949
export const pokemonApi = createApi({
5050
baseQuery: fetchBaseQuery({ baseUrl: 'https://pokeapi.co/api/v2/' }), // Set the baseUrl for every endpoint below

docs/tutorials/rtk-query.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ An RTK service generates a "slice reducer" that should be included in the Redux
7171

7272
```ts title="src/store.ts"
7373
import { configureStore } from '@reduxjs/toolkit'
74-
// Or from '@rtk-incubator/rtk-query/react'
74+
// Or from '@reduxjs/toolkit/query/react'
7575
import { setupListeners } from '@reduxjs/toolkit/query'
7676
import { pokemonApi } from './services/pokemon'
7777

docs/usage/rtk-query/customizing-create-api.md

Lines changed: 28 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -19,28 +19,42 @@ You can create your own versions of `createApi` by either specifying non-default
1919
If you want the hooks to use different versions of `useSelector` or `useDispatch`, for example if you are using a custom context, you can pass these in at module creation:
2020

2121
```ts
22-
import * as React from 'react';
23-
import { createDispatchHook, ReactReduxContextValue } from 'react-redux';
24-
import { buildCreateApi, coreModule, reactHooksModule } from '@rtk-incubator/rtk-query';
25-
26-
const MyContext = React.createContext<ReactReduxContextValue>(null as any);
27-
const customCreateApi = buildCreateApi(coreModule(), reactHooksModule({ useDispatch: createDispatchHook(MyContext) }));
22+
import * as React from 'react'
23+
import { createDispatchHook, ReactReduxContextValue } from 'react-redux'
24+
import {
25+
buildCreateApi,
26+
coreModule,
27+
reactHooksModule,
28+
} from '@reduxjs/toolkit/query'
29+
30+
const MyContext = React.createContext<ReactReduxContextValue>(null as any)
31+
const customCreateApi = buildCreateApi(
32+
coreModule(),
33+
reactHooksModule({ useDispatch: createDispatchHook(MyContext) })
34+
)
2835
```
2936

3037
## Creating your own module
3138

32-
If you want to create your own module, you should review [the react-hooks module](https://github.com/rtk-incubator/rtk-query/blob/main/src/react-hooks/module.ts) to see what an implementation would look like.
39+
If you want to create your own module, you should review [the react-hooks module](https://github.com/reduxjs/redux-toolkit/blob/b74a52935a5840bebca5acdc8e2265e3b6497afa/src/query/react/module.ts) to see what an implementation would look like.
3340

3441
Here is a very stripped down version:
3542

3643
```ts
37-
import { CoreModule } from '@internal/core/module';
38-
import { BaseQueryFn, EndpointDefinitions, Api, Module, buildCreateApi, coreModule } from '@rtk-incubator/rtk-query';
39-
40-
export const customModuleName = Symbol();
41-
export type CustomModule = typeof customModuleName;
42-
43-
declare module '@rtk-incubator/rtk-query' {
44+
import { CoreModule } from '@internal/core/module'
45+
import {
46+
BaseQueryFn,
47+
EndpointDefinitions,
48+
Api,
49+
Module,
50+
buildCreateApi,
51+
coreModule,
52+
} from '@reduxjs/toolkit/query'
53+
54+
export const customModuleName = Symbol()
55+
export type CustomModule = typeof customModuleName
56+
57+
declare module '../apiTypes' {
4458
export interface ApiModules<
4559
BaseQuery extends BaseQueryFn,
4660
Definitions extends EndpointDefinitions,

docs/usage/rtk-query/pagination.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ RTK Query makes it straightforward to integrate with a standard index-based pagi
1212
## Setup an endpoint to accept a page `arg`
1313

1414
```ts title="src/app/services/posts.ts"
15-
// Or from '@rtk-incubator/rtk-query/react'
16-
import { createApi, fetchBaseQuery } from "@rtk-incubator/rtk-query";
15+
// Or from '@reduxjs/toolkit/query/react'
16+
import { createApi, fetchBaseQuery } from "@reduxjs/toolkit/query";
1717

1818
interface ListResponse<T> {
1919
page: number;

src/query/createApi.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ export interface CreateApiOptions<
6161
*
6262
* ```js
6363
* // codeblock-meta title="apis.js"
64-
* import { createApi, fetchBaseQuery } from '@rtk-incubator/rtk-query';
64+
* import { createApi, fetchBaseQuery } from '@reduxjs/toolkit/query';
6565
*
6666
* const apiOne = createApi({
6767
* reducerPath: 'apiOne',

src/query/react/ApiProvider.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import { Api } from '../apiTypes'
1111
* ```ts
1212
* // codeblock-meta title="Basic usage - wrap your App with ApiProvider"
1313
* import * as React from 'react';
14-
* import { ApiProvider } from '@rtk-incubator/rtk-query';
14+
* import { ApiProvider } from '@reduxjs/toolkit/query/react';
1515
*
1616
* function App() {
1717
* return (

0 commit comments

Comments
 (0)