Skip to content

Referencing part of an intersection type retroactively strips info from the typing itself? #6217

@gausie

Description

@gausie

This is difficult to explain so check the Try example instead. For more information on the Return type utility at the top, check #4002.

Click to check the typing of Props (on line 16 for example) and see the following type info in the status bar
type Props = Return<(state: State) => {|example: State|}> & {|action: () => {|type: string|}|}

Now uncomment line 20 and check the typing of Props again. You will see that it has now become
type Props = Return<(state: State) => any> & {|action: () => any|}

As you can see, most of the typing information has been stripped, which is a problem.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions