Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix type of exported Touchables: ComponentType -> AbstractComponent #28737

Closed

Commits on Apr 23, 2020

  1. Fix type of exported Touchables by replacing ComponentType with Abstr…

    …actComponent
    
    Fixes facebook#28726
    When importing TouchableOpacity, it is treated as any by Flow. Replacing ComponentType with AbstractComponent works.
    
    The Flow documentation says the followin about ComponentType:
    > Note: In 0.89.0+, React.ComponentType is an alias for React.AbstractComponent<Config, any>, which represents a component with config type Config and any instance type.
    
    So I'm thinking that since the instance type is treated as any with ComponentType, Flow treats TouchableOpacity as any as well.
    draperunner committed Apr 23, 2020
    Configuration menu
    Copy the full SHA
    ee47132 View commit details
    Browse the repository at this point in the history