Skip to content

Type annotation needed only when component is root of exported component? #8166

@FezVrasta

Description

@FezVrasta

Flow version: 0.110.1

Expected behavior

The un-annotated component should not need any type annotations.

Actual behavior

Flow requires me to annotate a component if I'm gonna use it inside an exported component, but this happens only if the un-annotated component is rendered as root of the exported component.

If I wrap the un-annotated component with something else (a fragment, a div, etc), then Flow doesn't require me to annotate it.

I know Flow wants us to annotate the exported functions, components, etc... but I'm not exporting that component, I'm using it inside a component that's getting exported.

Why is it behaving this way?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions