Skip to content

Commit ad40b97

Browse files
authored
Merge pull request #1960 from OliverJAsh/patch-1
2 parents 8cf538c + 9e09869 commit ad40b97

File tree

2 files changed

+22
-3
lines changed

2 files changed

+22
-3
lines changed

src/components/Provider.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { createSubscription } from '../utils/Subscription'
44
import { useIsomorphicLayoutEffect } from '../utils/useIsomorphicLayoutEffect'
55
import { Action, AnyAction, Store } from 'redux'
66

7-
export interface ProviderProps<A extends Action = AnyAction, S = any> {
7+
export interface ProviderProps<A extends Action = AnyAction, S = unknown> {
88
/**
99
* The single Redux store in your application.
1010
*/
@@ -24,12 +24,12 @@ export interface ProviderProps<A extends Action = AnyAction, S = any> {
2424
children: ReactNode
2525
}
2626

27-
function Provider<A extends Action = AnyAction>({
27+
function Provider<A extends Action = AnyAction, S = unknown>({
2828
store,
2929
context,
3030
children,
3131
serverState,
32-
}: ProviderProps<A>) {
32+
}: ProviderProps<A, S>) {
3333
const contextValue = useMemo(() => {
3434
const subscription = createSubscription(store)
3535
return {

test/typetests/provider.tsx

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
/* eslint-disable @typescript-eslint/no-unused-vars */
2+
3+
import React from 'react'
4+
import { Provider } from '../../src'
5+
import { Store } from 'redux'
6+
7+
declare const store: Store<{ foo: string }>
8+
9+
function App() {
10+
return (
11+
<Provider
12+
store={store}
13+
// @ts-expect-error
14+
serverState={'oops'}
15+
>
16+
foo
17+
</Provider>
18+
)
19+
}

0 commit comments

Comments
 (0)