You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Sep 10, 2022. It is now read-only.
We use [email protected] and @types/[email protected] with the latest React. I'm not sure why, but for some reason, compose() HOC causes to loose typings for React component.
To demonstrate it I've created following simple code:
importReact,{Component,FunctionComponent}from'react';import{compose}from'recompose';typeComponent1Props={test: string;};constComponent1: FunctionComponent<Component1Props>=({ test })=><div>{test}</div>;constenhance=compose<Component1Props,Component1Props>();export{Component1};exportdefaultenhance(Component1);
We use
[email protected]
and@types/[email protected]
with the latest React. I'm not sure why, but for some reason,compose()
HOC causes to loose typings for React component.To demonstrate it I've created following simple code:
Here is what typescript generates in result:
As you can see,
Component1
withoutcompose()
generates types normally, but once we applycompose()
, we're going to lose all types.Could you please advise how to keep types for components when we use
compose()
?The text was updated successfully, but these errors were encountered: