Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
node_modules
build/
dist
lib
coverage
Expand Down Expand Up @@ -34,4 +35,5 @@ website/node_modules
website/i18n/*

tsconfig.vitest-temp.json

.vitest-dump/
.vitest/
4 changes: 4 additions & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ compressionLevel: mixed

enableGlobalCache: false

enableTransparentWorkspaces: false

nmSelfReferences: false

nodeLinker: node-modules

yarnPath: .yarn/releases/yarn-4.4.1.cjs
20 changes: 10 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@
"lint:fix": "eslint src test --fix",
"prepack": "yarn build",
"pretest": "yarn lint",
"test": "vitest --run --typecheck",
"test:watch": "vitest --watch",
"test": "vitest --run --config=${INIT_CWD}/vitest.config.mts",
"test:watch": "vitest --watch --config=${INIT_CWD}/vitest.config.mts",
"type-tests": "tsc --noEmit -p tsconfig.test.json",
"coverage": "codecov"
},
Expand All @@ -64,16 +64,16 @@
}
},
"dependencies": {
"@types/use-sync-external-store": "^0.0.6",
"use-sync-external-store": "^1.4.0"
"@types/use-sync-external-store": "^1.5.0",
"use-sync-external-store": "^1.6.0"
},
"devDependencies": {
"@arethetypeswrong/cli": "^0.18.3",
"@microsoft/api-extractor": "^7.47.0",
"@reduxjs/toolkit": "^2.2.5",
"@testing-library/dom": "^10.4.0",
"@testing-library/jest-dom": "^6.6.3",
"@testing-library/react": "^16.1.0",
"@reduxjs/toolkit": "^2.12.0",
"@testing-library/dom": "^10.4.1",
"@testing-library/jest-dom": "^6.9.1",
"@testing-library/react": "^16.3.2",
"@types/node": "^25.9.3",
"@types/prop-types": "^15.7.12",
"@types/react": "^19.0.1",
Expand All @@ -86,7 +86,7 @@
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-prettier": "^5.1.3",
"eslint-plugin-react": "^7.34.2",
"jsdom": "^25.0.1",
"jsdom": "^29.1.1",
"pkg-pr-new": "^0.0.75",
"prettier": "^3.3.3",
"react": "^19.2.0",
Expand All @@ -96,7 +96,7 @@
"tsup": "^8.5.1",
"typescript": "^5.8.2",
"typescript-eslint": "^7.12.0",
"vitest": "^4.1.8"
"vitest": "^4.1.9"
},
"packageManager": "yarn@4.4.1"
}
2 changes: 1 addition & 1 deletion src/hooks/useSelector.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//import * as React from 'react'
import { useSyncExternalStoreWithSelector } from 'use-sync-external-store/with-selector.js'
import { useSyncExternalStoreWithSelector } from 'use-sync-external-store/with-selector'
import type { ReactReduxContextValue } from '../components/Context'
import { ReactReduxContext } from '../components/Context'
import type { EqualityFn } from '../types'
Expand Down
2 changes: 2 additions & 0 deletions src/utils/react-is.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ function typeOf(object: any): symbol | undefined {
return $$typeof
}
}

return undefined
}

export function isContextConsumer(object: any): object is ReactElement {
Expand Down
18 changes: 9 additions & 9 deletions test/components/Provider.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ const createExampleTextReducer =
state

describe('React', () => {
describe('Provider', () => {
describe(Provider, () => {
const createChild = (storeKey = 'store') => {
class Child extends Component {
render() {
override render() {
return (
<ReactReduxContext.Consumer>
{(props) => {
Expand Down Expand Up @@ -105,7 +105,7 @@ describe('React', () => {
externalSetState = this.setState.bind(this)
}

render() {
override render() {
return (
<Provider store={this.state.store}>
<Child />
Expand Down Expand Up @@ -169,7 +169,7 @@ describe('React', () => {
count: state,
}))
class Inner extends Component<TStateProps> {
render(): JSX.Element {
override render(): JSX.Element {
return <div>{this.props.count}</div>
}
}
Expand All @@ -180,7 +180,7 @@ describe('React', () => {

const outerStore = createStore(reducer)
class Outer extends Component {
render() {
override render() {
return (
<Provider store={innerStore}>
<WrapperInner />
Expand Down Expand Up @@ -230,7 +230,7 @@ describe('React', () => {
parentState: string
}
class ChildContainer extends Component<ChildContainerProps> {
render() {
override render() {
return <div />
}
}
Expand All @@ -255,7 +255,7 @@ describe('React', () => {
store.dispatch({ type: 'APPEND', body: 'b' })
}

render() {
override render() {
return (
<div>
<button onClick={this.emitChange.bind(this)}>change</button>
Expand Down Expand Up @@ -366,7 +366,7 @@ describe('React', () => {
const storeB = createStore(reducerB)

class ComponentA extends Component<PropsType> {
render() {
override render() {
return <div data-testid="value">{this.props.value}</div>
}
}
Expand All @@ -378,7 +378,7 @@ describe('React', () => {
)(ComponentA)

class ComponentB extends Component<PropsType> {
render() {
override render() {
return <div data-testid="value">{this.props.value}</div>
}
}
Expand Down
Loading
Loading