Skip to content

react-native-a11y/has-valid-accessibility-state crashes when destructuring within prop. #146

@jaworek

Description

@jaworek

When accessibilityState prop is defined as an inline object with destructured object within it, this rule crashes.

accessibilityState={{ ...accessibilityState, disabled }}

Here's the error message:
photo_2022-09-27_12-09-56

I was able to find a workaround by defining it first as a separate variable and then passing it to prop.

const newAccessibilityState = { ...accessibilityState, disabled };

...

accessibilityState={newAccessibilityState}

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