Skip to content

Commit

Permalink
Merge pull request #1960 from OliverJAsh/patch-1
Browse files Browse the repository at this point in the history
  • Loading branch information
markerikson committed Nov 4, 2022
2 parents 8cf538c + 9e09869 commit ad40b97
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/components/Provider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { createSubscription } from '../utils/Subscription'
import { useIsomorphicLayoutEffect } from '../utils/useIsomorphicLayoutEffect'
import { Action, AnyAction, Store } from 'redux'

export interface ProviderProps<A extends Action = AnyAction, S = any> {
export interface ProviderProps<A extends Action = AnyAction, S = unknown> {
/**
* The single Redux store in your application.
*/
Expand All @@ -24,12 +24,12 @@ export interface ProviderProps<A extends Action = AnyAction, S = any> {
children: ReactNode
}

function Provider<A extends Action = AnyAction>({
function Provider<A extends Action = AnyAction, S = unknown>({
store,
context,
children,
serverState,
}: ProviderProps<A>) {
}: ProviderProps<A, S>) {
const contextValue = useMemo(() => {
const subscription = createSubscription(store)
return {
Expand Down
19 changes: 19 additions & 0 deletions test/typetests/provider.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/* eslint-disable @typescript-eslint/no-unused-vars */

import React from 'react'
import { Provider } from '../../src'
import { Store } from 'redux'

declare const store: Store<{ foo: string }>

function App() {
return (
<Provider
store={store}
// @ts-expect-error
serverState={'oops'}
>
foo
</Provider>
)
}

0 comments on commit ad40b97

Please sign in to comment.