Skip to content

Commit 7dc8f11

Browse files
committed
Update uSES usages and ignore outdated typedefs for imports
1 parent d50ba6a commit 7dc8f11

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

Diff for: src/components/connect.tsx

+8-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
11
/* eslint-disable valid-jsdoc, @typescript-eslint/no-unused-vars */
22
import hoistStatics from 'hoist-non-react-statics'
3-
import React, { useContext, useMemo, useRef, useReducer } from 'react'
3+
import React, {
4+
useContext,
5+
useMemo,
6+
useRef,
7+
useReducer,
8+
// @ts-ignore
9+
useSyncExternalStore,
10+
} from 'react'
411
import { isValidElementType, isContextConsumer } from 'react-is'
5-
import { useSyncExternalStore } from 'use-sync-external-store'
612

713
import type { Store, Dispatch, Action, AnyAction } from 'redux'
814

Diff for: src/hooks/useSelector.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { useContext, useDebugValue } from 'react'
22

3-
import { useSyncExternalStoreExtra } from 'use-sync-external-store/extra'
3+
// @ts-ignore
4+
import { useSyncExternalStoreWithSelector } from 'use-sync-external-store/with-selector'
45

56
import { useReduxContext as useDefaultReduxContext } from './useReduxContext'
67
import { ReactReduxContext } from '../components/Context'
@@ -45,7 +46,7 @@ export function createSelectorHook(
4546

4647
const { store } = useReduxContext()!
4748

48-
const selectedState = useSyncExternalStoreExtra(
49+
const selectedState = useSyncExternalStoreWithSelector(
4950
store.subscribe,
5051
store.getState,
5152
// TODO Need a server-side snapshot here

0 commit comments

Comments
 (0)