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
Event callbacks are typed as any with styled-components/native on React Native, based on this PR: #4086, this should be fixed and it is on the styled-components package but not on the styled-components/native.
Reproduction
importstyledfrom"styled-components/native";importReactfrom"react";exportconstContainer=styled.View({width: "100%",});typeProps={children?: React.ReactNode;}exportfunctionComponent({ children }): Props){const[containerWidth,setContainerWidth]=useState(0);return(<ContaineronLayout={event=>{// typed as anysetContainerWidth(event.nativeEvent.layout.width);}}>{children}</Container>);}
importReactfrom"react";import{View}from"react-native";typeProps={children?: React.ReactNode;}exportfunctionComponent({ children }): Props){const[containerWidth,setContainerWidth]=useState(0);return(<ViewonLayout={event=>{// typed correctly as LayoutChangeEventsetContainerWidth(event.nativeEvent.layout.width);}}>{children}</View>);}
Expected Behavior
Infer typing
Actual Behavior
Events are typed as any in styled-components/native
The text was updated successfully, but these errors were encountered:
Environment
System:
Binaries:
npmPackages:
Event callbacks are typed as
any
withstyled-components/native
on React Native, based on this PR: #4086, this should be fixed and it is on thestyled-components
package but not on thestyled-components/native
.Reproduction
Expected Behavior
Infer typing
Actual Behavior
Events are typed as any in styled-components/native
The text was updated successfully, but these errors were encountered: