Skip to content

[10.0.0-alpha.3] Component's onClick property should be a function #1504

@jessicabyrne

Description

@jessicabyrne

React alpha.3 is quite strict with type handling of components. I have a bunch of new errors for when it expects a function but gets an object or undefined back.

Uncaught (in promise) Error: Component's "onCancel" property should be a function, but got [object] instead

debug.module.js:1 Uncaught (in promise) Error: Component's "onFocus" property should be a function, but got [undefined] instead

Is this as expected? It would be fine if it were just in my code as I could fix it to never use onCancel={null}, but I'm getting errors back for dependencies I'm using, forcing me to add something like onFocus={()={}} even if I would prefer not to pass in that prop at all.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions