Skip to content

Divider (and possibly other components) allow overriding accessible/importantForAccessibility defaults via spread props #219

Description

@Chibuzor-Nwemambu

Background

Raised by Claude's automated review on PR #216.

`Divider.tsx` sets accessibility-hiding defaults, then spreads `{...rest}` after them:

```jsx
<View
style={[styles.divider, style]}
accessible={false}
importantForAccessibility="no"
{...rest}
/>
```

Since `{...rest}` comes last, a consumer passing `accessible` or `importantForAccessibility` explicitly would override Divider's "hidden from assistive technology" defaults.

Open question

Unlike the `Input` accessibilityState bug (#217), this isn't a clear-cut defect — it's a judgment call:

  • Is a Divider ever meant to be independently accessible/focusable? If not, the override should probably be blocked (reorder props so the defaults win, or explicitly omit `accessible`/`importantForAccessibility` from the spread).
  • If there's a legitimate use case for a consumer to override it, current behavior is fine as-is and this can be closed.

Where it surfaced

Discovered via Claude's review of PR #216 (issue #214 batch-1 tests). Not itself part of #214's scope.

Metadata

Metadata

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