react-native-segmented-control
react-native-segmented-control copied to clipboard
feat: Segment accessibility
This PR is based on the conversation in #31.
Since no new PR was added, and that PR was not updated, this one finishes the implementation started in that PR.
Changes
- Export
SegmentedControlPropsinterface - Added
Segmentinterface - Changed
segmentsfrom an array of strings to a mixed array of strings and Segment objects - Transforming
segmentsprop into an array of Segment objects and memoizing it. This keeps backwards compatibility by allowing a full array of strings to be passed - Setting default accessibility values in each segment Pressable
- Overriding the default accessibility values by spreading the remaining Segment accessibility values for each segment, if defined