Skip to content

Problem with forwardRef and hoist-non-react-statics #1

@benjaminbillet

Description

@benjaminbillet

In react/9-hoc:

Warning: React.createElement: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: object. You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.

This is caused by hoist-non-react-statics: mridgway/hoist-non-react-statics#48
forwardRef is quite a new primitive, it is not managed correctly by hoist-non-react-statics. I had to use the release candidate of the 3.0.0 to make it works, but this warning appeared.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions