Skip to content

[style-prop-object] False error: Style prop value must be an object #820

Closed
@tleunen

Description

@tleunen

The rule is throwing in my code with this example:

React.createElement(MyCustomElem, {
    [style]: true
}, `My custom Elem`)

if I rename the variable style with something else, everything is fine.

Cannot read property 'name' of undefined
TypeError: Cannot read property 'name' of undefined
    at /Users/tommy.leunen/dev/pppp/node_modules/eslint-plugin-react/lib/rules/style-prop-object.js:51:34
    at Array.find (native)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions