Skip to content

Commit

Permalink
Update uSES usages and ignore outdated typedefs for imports
Browse files Browse the repository at this point in the history
  • Loading branch information
markerikson committed Nov 2, 2021
1 parent ea0a3f8 commit c9bf4ca
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
10 changes: 8 additions & 2 deletions src/components/connect.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
/* eslint-disable valid-jsdoc, @typescript-eslint/no-unused-vars */
import hoistStatics from 'hoist-non-react-statics'
import React, { useContext, useMemo, useRef, useReducer } from 'react'
import React, {
useContext,
useMemo,
useRef,
useReducer,
// @ts-ignore
useSyncExternalStore,
} from 'react'
import { isValidElementType, isContextConsumer } from 'react-is'
import { useSyncExternalStore } from 'use-sync-external-store'

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

Expand Down
5 changes: 3 additions & 2 deletions src/hooks/useSelector.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { useContext, useDebugValue } from 'react'

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

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

const { store } = useReduxContext()!

const selectedState = useSyncExternalStoreExtra(
const selectedState = useSyncExternalStoreWithSelector(
store.subscribe,
store.getState,
// TODO Need a server-side snapshot here
Expand Down

0 comments on commit c9bf4ca

Please sign in to comment.