Skip to content

Commit

Permalink
Fix TS 4.7 compile issue
Browse files Browse the repository at this point in the history
  • Loading branch information
markerikson committed Apr 2, 2022
1 parent 4409a2f commit 687ddfa
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/connect/wrapMapToProps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ type StateOrDispatch<S = AnyState> = S | Dispatch

type AnyProps = { [key: string]: any }

export type MapToProps<P = AnyProps> = {
export type MapToProps<P extends AnyProps = AnyProps> = {
// eslint-disable-next-line no-unused-vars
(stateOrDispatch: StateOrDispatch, ownProps?: P): FixTypeLater
dependsOnOwnProps?: boolean
Expand Down Expand Up @@ -65,7 +65,7 @@ export function getDependsOnOwnProps(mapToProps: MapToProps) {
// * On first call, verifies the first result is a plain object, in order to warn
// the developer that their mapToProps function is not returning a valid result.
//
export function wrapMapToPropsFunc<P = AnyProps>(
export function wrapMapToPropsFunc<P extends AnyProps = AnyProps>(
mapToProps: MapToProps,
methodName: string
) {
Expand Down

0 comments on commit 687ddfa

Please sign in to comment.