Skip to content

Commit

Permalink
Merge pull request #4336 from aryaemami59/fix-custom-context-examples
Browse files Browse the repository at this point in the history
Update remaining `Context` references to match the new nullable `Context`
  • Loading branch information
EskiMojo14 authored Apr 10, 2024
2 parents fd52689 + fb97665 commit dc1548e
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion docs/rtk-query/usage/customizing-create-api.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ import {
reactHooksModule,
} from '@reduxjs/toolkit/query/react'

const MyContext = React.createContext<ReactReduxContextValue>(null as any)
const MyContext = React.createContext<ReactReduxContextValue | null>(null)
const customCreateApi = buildCreateApi(
coreModule(),
reactHooksModule({
Expand Down
2 changes: 1 addition & 1 deletion packages/toolkit/etc/rtk-query-react.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ export function ApiProvider<A extends Api<any, {}, any, any>>(props: {
children: any
api: A
setupListeners?: Parameters<typeof setupListeners>[1]
context?: Context<ReactReduxContextValue>
context?: Context<ReactReduxContextValue | null>
}): JSX.Element

// @public (undocumented)
Expand Down
2 changes: 1 addition & 1 deletion packages/toolkit/src/query/createApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ export type CreateApi<Modules extends ModuleName> = {
*
* @example
* ```ts
* const MyContext = React.createContext<ReactReduxContextValue>(null as any);
* const MyContext = React.createContext<ReactReduxContextValue | null>(null);
* const customCreateApi = buildCreateApi(
* coreModule(),
* reactHooksModule({
Expand Down
2 changes: 1 addition & 1 deletion packages/toolkit/src/query/react/module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ export interface ReactHooksModuleOptions {
*
* @example
* ```ts
* const MyContext = React.createContext<ReactReduxContextValue>(null as any);
* const MyContext = React.createContext<ReactReduxContextValue | null>(null);
* const customCreateApi = buildCreateApi(
* coreModule(),
* reactHooksModule({
Expand Down

0 comments on commit dc1548e

Please sign in to comment.