Wrapping react-redux's connect function in TypeScript results in compilation error
I'm trying to wrap react-redux's connect
function into a helper function for a test utility.
Below is a simplified example:
interface IProps {
number: number
}
class NumberDisplay extends React.PureComponent<IProps> {
render() {
return `${this.props.number}`
}
}
function mapStateToProps(state: any) {
return {number: 1}
}
The following works as expected:
const ConnectedNumberDisplay1 = connect(mapStateToProps)(NumberDisplay)
export const display1 = <ConnectedNumberDisplay1 />
and it provides helpful type checks: if number
is never set, the compilation will fail.
My wrap function looks like this:
function wrap<StateProps, ComponentProps>(
mapStateToProps: (state: any) => StateProps,
Component: React.ComponentType<ComponentProps>
) {
return connect(mapStateToProps)(Component)
// ^^^^^^^^^ Error happens here
}
const ConnectedNumberDisplay2 = conn(mapStateToProps, NumberDisplay)
export const display2 = <ConnectedNumberDisplay2 />
This is the error:
Argument of type 'ComponentType<ComponentProps>' is not assignable to parameter of type 'ComponentType<Matching<StateProps & DispatchProp<AnyAction>, ComponentProps>>'.
Type 'ComponentClass<ComponentProps, any>' is not assignable to type 'ComponentType<Matching<StateProps & DispatchProp<AnyAction>, ComponentProps>>'.
Type 'ComponentClass<ComponentProps, any>' is not assignable to type 'ComponentClass<Matching<StateProps & DispatchProp<AnyAction>, ComponentProps>, any>'.
Types of property 'propTypes' are incompatible.
Type 'WeakValidationMap<ComponentProps> | undefined' is not assignable to type 'WeakValidationMap<Matching<StateProps & DispatchProp<AnyAction>, ComponentProps>> | undefined'.
Type 'WeakValidationMap<ComponentProps>' is not assignable to type 'WeakValidationMap<Matching<StateProps & DispatchProp<AnyAction>, ComponentProps>>'.
Type '(null extends ComponentProps[K] ? Validator<ComponentProps[K] | null | undefined> : undefined extends ComponentProps[K] ? Validator<ComponentProps[K] | null | undefined> : Validator<ComponentProps[K]>) | undefined' is not assignable to type '(null extends Matching<StateProps & DispatchProp<AnyAction>, ComponentProps>[K] ? Validator<Matching<StateProps & DispatchProp<AnyAction>, ComponentProps>[K] | null | undefined> : undefined extends Matching<...>[K] ? Validator<...> : Validator<...>) | undefined'.
Type 'null extends ComponentProps[K] ? Validator<ComponentProps[K] | null | undefined> : undefined extends ComponentProps[K] ? Validator<ComponentProps[K] | null | undefined> : Validator<ComponentProps[K]>' is not assignable to type '(null extends Matching<StateProps & DispatchProp<AnyAction>, ComponentProps>[K] ? Validator<Matching<StateProps & DispatchProp<AnyAction>, ComponentProps>[K] | null | undefined> : undefined extends Matching<...>[K] ? Validator<...> : Validator<...>) | undefined'.
Type 'Validator<ComponentProps[K] | null | undefined> | (undefined extends ComponentProps[K] ? Validator<ComponentProps[K] | null | undefined> : Validator<ComponentProps[K]>)' is not assignable to type '(null extends Matching<StateProps & DispatchProp<AnyAction>, ComponentProps>[K] ? Validator<Matching<StateProps & DispatchProp<AnyAction>, ComponentProps>[K] | null | undefined> : undefined extends Matching<...>[K] ? Validator<...> : Validator<...>) | undefined'.
Type 'Validator<ComponentProps[K] | null | undefined>' is not assignable to type 'null extends Matching<StateProps & DispatchProp<AnyAction>, ComponentProps>[K] ? Validator<Matching<StateProps & DispatchProp<AnyAction>, ComponentProps>[K] | null | undefined> : undefined extends Matching<...>[K] ? Validator<...> : Validator<...>'.
Type 'null extends ComponentProps[K] ? Validator<ComponentProps[K] | null | undefined> : undefined extends ComponentProps[K] ? Validator<ComponentProps[K] | null | undefined> : Validator<ComponentProps[K]>' is not assignable to type 'null extends Matching<StateProps & DispatchProp<AnyAction>, ComponentProps>[K] ? Validator<Matching<StateProps & DispatchProp<AnyAction>, ComponentProps>[K] | null | undefined> : undefined extends Matching<...>[K] ? Validator<...> : Validator<...>'.
As a temporary workaround, I'm using something like this:
function wrap<StateProps, ComponentProps>(
mapStateToProps: (state: any) => StateProps,
Component: React.ComponentType<ComponentProps>,
): React.ComponentType<
Omit<ComponentProps, keyof StateProps & keyof ComponentProps>> {
return connect(mapStateToProps)(Component as any) as any
But I'd prefer not to use any
if possible. I'm not sure what I'm missing here. Any help is appreciated!
typescript react-redux
add a comment |
I'm trying to wrap react-redux's connect
function into a helper function for a test utility.
Below is a simplified example:
interface IProps {
number: number
}
class NumberDisplay extends React.PureComponent<IProps> {
render() {
return `${this.props.number}`
}
}
function mapStateToProps(state: any) {
return {number: 1}
}
The following works as expected:
const ConnectedNumberDisplay1 = connect(mapStateToProps)(NumberDisplay)
export const display1 = <ConnectedNumberDisplay1 />
and it provides helpful type checks: if number
is never set, the compilation will fail.
My wrap function looks like this:
function wrap<StateProps, ComponentProps>(
mapStateToProps: (state: any) => StateProps,
Component: React.ComponentType<ComponentProps>
) {
return connect(mapStateToProps)(Component)
// ^^^^^^^^^ Error happens here
}
const ConnectedNumberDisplay2 = conn(mapStateToProps, NumberDisplay)
export const display2 = <ConnectedNumberDisplay2 />
This is the error:
Argument of type 'ComponentType<ComponentProps>' is not assignable to parameter of type 'ComponentType<Matching<StateProps & DispatchProp<AnyAction>, ComponentProps>>'.
Type 'ComponentClass<ComponentProps, any>' is not assignable to type 'ComponentType<Matching<StateProps & DispatchProp<AnyAction>, ComponentProps>>'.
Type 'ComponentClass<ComponentProps, any>' is not assignable to type 'ComponentClass<Matching<StateProps & DispatchProp<AnyAction>, ComponentProps>, any>'.
Types of property 'propTypes' are incompatible.
Type 'WeakValidationMap<ComponentProps> | undefined' is not assignable to type 'WeakValidationMap<Matching<StateProps & DispatchProp<AnyAction>, ComponentProps>> | undefined'.
Type 'WeakValidationMap<ComponentProps>' is not assignable to type 'WeakValidationMap<Matching<StateProps & DispatchProp<AnyAction>, ComponentProps>>'.
Type '(null extends ComponentProps[K] ? Validator<ComponentProps[K] | null | undefined> : undefined extends ComponentProps[K] ? Validator<ComponentProps[K] | null | undefined> : Validator<ComponentProps[K]>) | undefined' is not assignable to type '(null extends Matching<StateProps & DispatchProp<AnyAction>, ComponentProps>[K] ? Validator<Matching<StateProps & DispatchProp<AnyAction>, ComponentProps>[K] | null | undefined> : undefined extends Matching<...>[K] ? Validator<...> : Validator<...>) | undefined'.
Type 'null extends ComponentProps[K] ? Validator<ComponentProps[K] | null | undefined> : undefined extends ComponentProps[K] ? Validator<ComponentProps[K] | null | undefined> : Validator<ComponentProps[K]>' is not assignable to type '(null extends Matching<StateProps & DispatchProp<AnyAction>, ComponentProps>[K] ? Validator<Matching<StateProps & DispatchProp<AnyAction>, ComponentProps>[K] | null | undefined> : undefined extends Matching<...>[K] ? Validator<...> : Validator<...>) | undefined'.
Type 'Validator<ComponentProps[K] | null | undefined> | (undefined extends ComponentProps[K] ? Validator<ComponentProps[K] | null | undefined> : Validator<ComponentProps[K]>)' is not assignable to type '(null extends Matching<StateProps & DispatchProp<AnyAction>, ComponentProps>[K] ? Validator<Matching<StateProps & DispatchProp<AnyAction>, ComponentProps>[K] | null | undefined> : undefined extends Matching<...>[K] ? Validator<...> : Validator<...>) | undefined'.
Type 'Validator<ComponentProps[K] | null | undefined>' is not assignable to type 'null extends Matching<StateProps & DispatchProp<AnyAction>, ComponentProps>[K] ? Validator<Matching<StateProps & DispatchProp<AnyAction>, ComponentProps>[K] | null | undefined> : undefined extends Matching<...>[K] ? Validator<...> : Validator<...>'.
Type 'null extends ComponentProps[K] ? Validator<ComponentProps[K] | null | undefined> : undefined extends ComponentProps[K] ? Validator<ComponentProps[K] | null | undefined> : Validator<ComponentProps[K]>' is not assignable to type 'null extends Matching<StateProps & DispatchProp<AnyAction>, ComponentProps>[K] ? Validator<Matching<StateProps & DispatchProp<AnyAction>, ComponentProps>[K] | null | undefined> : undefined extends Matching<...>[K] ? Validator<...> : Validator<...>'.
As a temporary workaround, I'm using something like this:
function wrap<StateProps, ComponentProps>(
mapStateToProps: (state: any) => StateProps,
Component: React.ComponentType<ComponentProps>,
): React.ComponentType<
Omit<ComponentProps, keyof StateProps & keyof ComponentProps>> {
return connect(mapStateToProps)(Component as any) as any
But I'd prefer not to use any
if possible. I'm not sure what I'm missing here. Any help is appreciated!
typescript react-redux
I've got a similar problem. Can you please check what version of@types/react
you have installed? In my case it works with@types/react@16.7.13
, but not@types/react@16.7.14
(or later), when thatWeakValidationMap
has been added, see github.com/DefinitelyTyped/DefinitelyTyped/commit/….
– Nick
Jan 31 at 16:40
add a comment |
I'm trying to wrap react-redux's connect
function into a helper function for a test utility.
Below is a simplified example:
interface IProps {
number: number
}
class NumberDisplay extends React.PureComponent<IProps> {
render() {
return `${this.props.number}`
}
}
function mapStateToProps(state: any) {
return {number: 1}
}
The following works as expected:
const ConnectedNumberDisplay1 = connect(mapStateToProps)(NumberDisplay)
export const display1 = <ConnectedNumberDisplay1 />
and it provides helpful type checks: if number
is never set, the compilation will fail.
My wrap function looks like this:
function wrap<StateProps, ComponentProps>(
mapStateToProps: (state: any) => StateProps,
Component: React.ComponentType<ComponentProps>
) {
return connect(mapStateToProps)(Component)
// ^^^^^^^^^ Error happens here
}
const ConnectedNumberDisplay2 = conn(mapStateToProps, NumberDisplay)
export const display2 = <ConnectedNumberDisplay2 />
This is the error:
Argument of type 'ComponentType<ComponentProps>' is not assignable to parameter of type 'ComponentType<Matching<StateProps & DispatchProp<AnyAction>, ComponentProps>>'.
Type 'ComponentClass<ComponentProps, any>' is not assignable to type 'ComponentType<Matching<StateProps & DispatchProp<AnyAction>, ComponentProps>>'.
Type 'ComponentClass<ComponentProps, any>' is not assignable to type 'ComponentClass<Matching<StateProps & DispatchProp<AnyAction>, ComponentProps>, any>'.
Types of property 'propTypes' are incompatible.
Type 'WeakValidationMap<ComponentProps> | undefined' is not assignable to type 'WeakValidationMap<Matching<StateProps & DispatchProp<AnyAction>, ComponentProps>> | undefined'.
Type 'WeakValidationMap<ComponentProps>' is not assignable to type 'WeakValidationMap<Matching<StateProps & DispatchProp<AnyAction>, ComponentProps>>'.
Type '(null extends ComponentProps[K] ? Validator<ComponentProps[K] | null | undefined> : undefined extends ComponentProps[K] ? Validator<ComponentProps[K] | null | undefined> : Validator<ComponentProps[K]>) | undefined' is not assignable to type '(null extends Matching<StateProps & DispatchProp<AnyAction>, ComponentProps>[K] ? Validator<Matching<StateProps & DispatchProp<AnyAction>, ComponentProps>[K] | null | undefined> : undefined extends Matching<...>[K] ? Validator<...> : Validator<...>) | undefined'.
Type 'null extends ComponentProps[K] ? Validator<ComponentProps[K] | null | undefined> : undefined extends ComponentProps[K] ? Validator<ComponentProps[K] | null | undefined> : Validator<ComponentProps[K]>' is not assignable to type '(null extends Matching<StateProps & DispatchProp<AnyAction>, ComponentProps>[K] ? Validator<Matching<StateProps & DispatchProp<AnyAction>, ComponentProps>[K] | null | undefined> : undefined extends Matching<...>[K] ? Validator<...> : Validator<...>) | undefined'.
Type 'Validator<ComponentProps[K] | null | undefined> | (undefined extends ComponentProps[K] ? Validator<ComponentProps[K] | null | undefined> : Validator<ComponentProps[K]>)' is not assignable to type '(null extends Matching<StateProps & DispatchProp<AnyAction>, ComponentProps>[K] ? Validator<Matching<StateProps & DispatchProp<AnyAction>, ComponentProps>[K] | null | undefined> : undefined extends Matching<...>[K] ? Validator<...> : Validator<...>) | undefined'.
Type 'Validator<ComponentProps[K] | null | undefined>' is not assignable to type 'null extends Matching<StateProps & DispatchProp<AnyAction>, ComponentProps>[K] ? Validator<Matching<StateProps & DispatchProp<AnyAction>, ComponentProps>[K] | null | undefined> : undefined extends Matching<...>[K] ? Validator<...> : Validator<...>'.
Type 'null extends ComponentProps[K] ? Validator<ComponentProps[K] | null | undefined> : undefined extends ComponentProps[K] ? Validator<ComponentProps[K] | null | undefined> : Validator<ComponentProps[K]>' is not assignable to type 'null extends Matching<StateProps & DispatchProp<AnyAction>, ComponentProps>[K] ? Validator<Matching<StateProps & DispatchProp<AnyAction>, ComponentProps>[K] | null | undefined> : undefined extends Matching<...>[K] ? Validator<...> : Validator<...>'.
As a temporary workaround, I'm using something like this:
function wrap<StateProps, ComponentProps>(
mapStateToProps: (state: any) => StateProps,
Component: React.ComponentType<ComponentProps>,
): React.ComponentType<
Omit<ComponentProps, keyof StateProps & keyof ComponentProps>> {
return connect(mapStateToProps)(Component as any) as any
But I'd prefer not to use any
if possible. I'm not sure what I'm missing here. Any help is appreciated!
typescript react-redux
I'm trying to wrap react-redux's connect
function into a helper function for a test utility.
Below is a simplified example:
interface IProps {
number: number
}
class NumberDisplay extends React.PureComponent<IProps> {
render() {
return `${this.props.number}`
}
}
function mapStateToProps(state: any) {
return {number: 1}
}
The following works as expected:
const ConnectedNumberDisplay1 = connect(mapStateToProps)(NumberDisplay)
export const display1 = <ConnectedNumberDisplay1 />
and it provides helpful type checks: if number
is never set, the compilation will fail.
My wrap function looks like this:
function wrap<StateProps, ComponentProps>(
mapStateToProps: (state: any) => StateProps,
Component: React.ComponentType<ComponentProps>
) {
return connect(mapStateToProps)(Component)
// ^^^^^^^^^ Error happens here
}
const ConnectedNumberDisplay2 = conn(mapStateToProps, NumberDisplay)
export const display2 = <ConnectedNumberDisplay2 />
This is the error:
Argument of type 'ComponentType<ComponentProps>' is not assignable to parameter of type 'ComponentType<Matching<StateProps & DispatchProp<AnyAction>, ComponentProps>>'.
Type 'ComponentClass<ComponentProps, any>' is not assignable to type 'ComponentType<Matching<StateProps & DispatchProp<AnyAction>, ComponentProps>>'.
Type 'ComponentClass<ComponentProps, any>' is not assignable to type 'ComponentClass<Matching<StateProps & DispatchProp<AnyAction>, ComponentProps>, any>'.
Types of property 'propTypes' are incompatible.
Type 'WeakValidationMap<ComponentProps> | undefined' is not assignable to type 'WeakValidationMap<Matching<StateProps & DispatchProp<AnyAction>, ComponentProps>> | undefined'.
Type 'WeakValidationMap<ComponentProps>' is not assignable to type 'WeakValidationMap<Matching<StateProps & DispatchProp<AnyAction>, ComponentProps>>'.
Type '(null extends ComponentProps[K] ? Validator<ComponentProps[K] | null | undefined> : undefined extends ComponentProps[K] ? Validator<ComponentProps[K] | null | undefined> : Validator<ComponentProps[K]>) | undefined' is not assignable to type '(null extends Matching<StateProps & DispatchProp<AnyAction>, ComponentProps>[K] ? Validator<Matching<StateProps & DispatchProp<AnyAction>, ComponentProps>[K] | null | undefined> : undefined extends Matching<...>[K] ? Validator<...> : Validator<...>) | undefined'.
Type 'null extends ComponentProps[K] ? Validator<ComponentProps[K] | null | undefined> : undefined extends ComponentProps[K] ? Validator<ComponentProps[K] | null | undefined> : Validator<ComponentProps[K]>' is not assignable to type '(null extends Matching<StateProps & DispatchProp<AnyAction>, ComponentProps>[K] ? Validator<Matching<StateProps & DispatchProp<AnyAction>, ComponentProps>[K] | null | undefined> : undefined extends Matching<...>[K] ? Validator<...> : Validator<...>) | undefined'.
Type 'Validator<ComponentProps[K] | null | undefined> | (undefined extends ComponentProps[K] ? Validator<ComponentProps[K] | null | undefined> : Validator<ComponentProps[K]>)' is not assignable to type '(null extends Matching<StateProps & DispatchProp<AnyAction>, ComponentProps>[K] ? Validator<Matching<StateProps & DispatchProp<AnyAction>, ComponentProps>[K] | null | undefined> : undefined extends Matching<...>[K] ? Validator<...> : Validator<...>) | undefined'.
Type 'Validator<ComponentProps[K] | null | undefined>' is not assignable to type 'null extends Matching<StateProps & DispatchProp<AnyAction>, ComponentProps>[K] ? Validator<Matching<StateProps & DispatchProp<AnyAction>, ComponentProps>[K] | null | undefined> : undefined extends Matching<...>[K] ? Validator<...> : Validator<...>'.
Type 'null extends ComponentProps[K] ? Validator<ComponentProps[K] | null | undefined> : undefined extends ComponentProps[K] ? Validator<ComponentProps[K] | null | undefined> : Validator<ComponentProps[K]>' is not assignable to type 'null extends Matching<StateProps & DispatchProp<AnyAction>, ComponentProps>[K] ? Validator<Matching<StateProps & DispatchProp<AnyAction>, ComponentProps>[K] | null | undefined> : undefined extends Matching<...>[K] ? Validator<...> : Validator<...>'.
As a temporary workaround, I'm using something like this:
function wrap<StateProps, ComponentProps>(
mapStateToProps: (state: any) => StateProps,
Component: React.ComponentType<ComponentProps>,
): React.ComponentType<
Omit<ComponentProps, keyof StateProps & keyof ComponentProps>> {
return connect(mapStateToProps)(Component as any) as any
But I'd prefer not to use any
if possible. I'm not sure what I'm missing here. Any help is appreciated!
typescript react-redux
typescript react-redux
asked Jan 20 at 14:23
jeremijajeremija
1,3621121
1,3621121
I've got a similar problem. Can you please check what version of@types/react
you have installed? In my case it works with@types/react@16.7.13
, but not@types/react@16.7.14
(or later), when thatWeakValidationMap
has been added, see github.com/DefinitelyTyped/DefinitelyTyped/commit/….
– Nick
Jan 31 at 16:40
add a comment |
I've got a similar problem. Can you please check what version of@types/react
you have installed? In my case it works with@types/react@16.7.13
, but not@types/react@16.7.14
(or later), when thatWeakValidationMap
has been added, see github.com/DefinitelyTyped/DefinitelyTyped/commit/….
– Nick
Jan 31 at 16:40
I've got a similar problem. Can you please check what version of
@types/react
you have installed? In my case it works with @types/react@16.7.13
, but not @types/react@16.7.14
(or later), when that WeakValidationMap
has been added, see github.com/DefinitelyTyped/DefinitelyTyped/commit/….– Nick
Jan 31 at 16:40
I've got a similar problem. Can you please check what version of
@types/react
you have installed? In my case it works with @types/react@16.7.13
, but not @types/react@16.7.14
(or later), when that WeakValidationMap
has been added, see github.com/DefinitelyTyped/DefinitelyTyped/commit/….– Nick
Jan 31 at 16:40
add a comment |
0
active
oldest
votes
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54277411%2fwrapping-react-reduxs-connect-function-in-typescript-results-in-compilation-err%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54277411%2fwrapping-react-reduxs-connect-function-in-typescript-results-in-compilation-err%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
I've got a similar problem. Can you please check what version of
@types/react
you have installed? In my case it works with@types/react@16.7.13
, but not@types/react@16.7.14
(or later), when thatWeakValidationMap
has been added, see github.com/DefinitelyTyped/DefinitelyTyped/commit/….– Nick
Jan 31 at 16:40