react-native-paper icon indicating copy to clipboard operation
react-native-paper copied to clipboard

fix: switch state sync when used inside a Portal on iOS

Open PaitoAnderson opened this issue 5 months ago • 1 comments

Motivation

When a <Switch /> is inside a <Portal /> you must tap the switch component twice to visually toggle the state on iOS.

Related issue

Fixes #4789

Test plan

I updated the example app to Expo 54, and then added this code in the SwitchExample.tsx file and tried toggling with a single tap.

<Portal>
  <View style={[styles.row, { top: 500 }]}>
    <TextComponent>Portal {checked ? 'on' : 'off'}</TextComponent>
    <Switch value={checked} onValueChange={setChecked} />
  </View>
</Portal>

PaitoAnderson avatar Oct 10 '25 00:10 PaitoAnderson

Hey @PaitoAnderson, thank you for your pull request 🤗. The documentation from this branch can be viewed here.

callstack-bot avatar Oct 10 '25 00:10 callstack-bot