diff --git a/.github/workflows/size.yaml b/.github/workflows/size.yaml index bd2ef5575..b8ec0ae3c 100644 --- a/.github/workflows/size.yaml +++ b/.github/workflows/size.yaml @@ -8,9 +8,9 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2-beta + - uses: actions/checkout@v3 with: fetch-depth: 1 - - uses: preactjs/compressed-size-action@v1 + - uses: preactjs/compressed-size-action@v2 with: repo-token: '${{ secrets.GITHUB_TOKEN }}' diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 03de6d6d1..c440d0e17 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -14,10 +14,10 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Set up Node - uses: actions/setup-node@v2 + uses: actions/setup-node@v3 with: node-version: 16.x cache: 'yarn' @@ -37,7 +37,7 @@ jobs: - name: Pack run: yarn pack - - uses: actions/upload-artifact@v2 + - uses: actions/upload-artifact@v3 with: name: package path: ./package.tgz @@ -54,10 +54,10 @@ jobs: ts: ['4.7', '4.8', '4.9', '5.0'] steps: - name: Checkout repo - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Use node ${{ matrix.node }} - uses: actions/setup-node@v2 + uses: actions/setup-node@v3 with: node-version: ${{ matrix.node }} cache: 'yarn' @@ -88,10 +88,10 @@ jobs: working-directory: ./examples/publish-ci/${{ matrix.example }} steps: - name: Checkout repo - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Use node ${{ matrix.node }} - uses: actions/setup-node@v2 + uses: actions/setup-node@v3 with: node-version: ${{ matrix.node }} cache: 'yarn' @@ -102,7 +102,7 @@ jobs: - name: Remove existing React-Redux run: yarn remove react-redux - - uses: actions/download-artifact@v2 + - uses: actions/download-artifact@v3 with: name: package path: ./examples/publish-ci/${{ matrix.example }} diff --git a/package.json b/package.json index 1f3a853b8..99f275685 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "react-redux", - "version": "8.1.0", + "version": "8.1.1", "description": "Official React bindings for Redux", "keywords": [ "react", @@ -40,7 +40,6 @@ "coverage": "codecov" }, "peerDependencies": { - "@reduxjs/toolkit": "^1 || ^2.0.0-beta.0", "@types/react": "^16.8 || ^17.0 || ^18.0", "@types/react-dom": "^16.8 || ^17.0 || ^18.0", "react": "^16.8 || ^17.0 || ^18.0", @@ -49,9 +48,6 @@ "redux": "^4 || ^5.0.0-beta.0" }, "peerDependenciesMeta": { - "@reduxjs/toolkit": { - "optional": true - }, "@types/react": { "optional": true }, diff --git a/src/components/Context.ts b/src/components/Context.ts index 8454e09f1..72e3fb10e 100644 --- a/src/components/Context.ts +++ b/src/components/Context.ts @@ -1,4 +1,4 @@ -import { createContext } from 'react' +import { createContext, version as ReactVersion } from 'react' import type { Context } from 'react' import type { Action, AnyAction, Store } from 'redux' import type { Subscription } from '../utils/Subscription' @@ -15,13 +15,17 @@ export interface ReactReduxContextValue< noopCheck: CheckFrequency } -let realContext: Context | null = null +const ContextKey = Symbol.for(`react-redux-context-${ReactVersion}`) +const gT = globalThis as { [ContextKey]?: Context } + function getContext() { + let realContext = gT[ContextKey] if (!realContext) { realContext = createContext(null as any) if (process.env.NODE_ENV !== 'production') { realContext.displayName = 'ReactRedux' } + gT[ContextKey] = realContext } return realContext } diff --git a/src/hooks/useSelector.ts b/src/hooks/useSelector.ts index e4c232e7d..c0363b4a5 100644 --- a/src/hooks/useSelector.ts +++ b/src/hooks/useSelector.ts @@ -17,7 +17,7 @@ export interface UseSelectorOptions { noopCheck?: CheckFrequency } -interface UseSelector { +export interface UseSelector { ( selector: (state: TState) => Selected, equalityFn?: EqualityFn diff --git a/website/docusaurus.config.js b/website/docusaurus.config.js index 921e2c688..59d4459d9 100644 --- a/website/docusaurus.config.js +++ b/website/docusaurus.config.js @@ -198,7 +198,7 @@ const siteConfig = { /** @type {import('@dipakparmar/docusaurus-plugin-umami').Options} */ ({ websiteID: 'e81a2686-96f3-4557-9c03-f584b7e8ab6b', - analyticsDomain: 'redux-docs-umami.vercel.app', + analyticsDomain: 'redux-docs-umami.up.railway.app', scriptName: 'script.js', dataAutoTrack: true, dataDoNotTrack: true, diff --git a/yarn.lock b/yarn.lock index ac58946bc..90a71db63 100644 --- a/yarn.lock +++ b/yarn.lock @@ -8931,7 +8931,6 @@ __metadata: typescript: ^4.3.4 use-sync-external-store: ^1.0.0 peerDependencies: - "@reduxjs/toolkit": ^1 || ^2.0.0-beta.0 "@types/react": ^16.8 || ^17.0 || ^18.0 "@types/react-dom": ^16.8 || ^17.0 || ^18.0 react: ^16.8 || ^17.0 || ^18.0 @@ -8939,8 +8938,6 @@ __metadata: react-native: ">=0.59" redux: ^4 || ^5.0.0-beta.0 peerDependenciesMeta: - "@reduxjs/toolkit": - optional: true "@types/react": optional: true "@types/react-dom":