Skip to content

Commit 184fe27

Browse files
authored
support spread props in has-accessibility-state (#132)
1 parent b5ad699 commit 184fe27

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

__tests__/src/rules/has-valid-accessibility-state-test.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,12 @@ ruleTester.run('has-valid-accessibility-state', rule, {
9191
accessibilityState={accessibilityState}
9292
/>`,
9393
},
94+
{
95+
code: `<TouchableOpacity
96+
{...localProps}
97+
accessibilityState={accessibilityState}
98+
/>`,
99+
},
94100
].map(parserOptionsMapper),
95101
invalid: [
96102
{

src/rules/has-valid-accessibility-state.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ module.exports = {
2929
if (hasProp(node.attributes, PROP_NAME)) {
3030
const stateProp = node.attributes.find(
3131
// $FlowFixMe
32-
(f) => f.name.name === PROP_NAME
32+
(f) => f.name?.name === PROP_NAME
3333
);
3434
const statePropType =
3535
// $FlowFixMe

0 commit comments

Comments
 (0)