react-native-switch-pro: Not displaying correctly when given value from props
When I give the Switch a boolean value stored in props, the initial rendering of the switch is messing up:
Here is my code:
<Switch
width={60}
height={30}
circleColor={'white'}
backgroundInactive={'rgba(255,255,255,0.2)'}
backgroundActive={appColors.green}
value={this.props.bookable}
onSyncPress={value => this.props.inputChanged({ prop: 'bookable', value })}
/>
Any thoughts?
About this issue
- Original URL
- State: closed
- Created 10 years ago
- Comments: 17 (9 by maintainers)
Commits related to this issue
- Merge pull request #1 from react-native-oh-library/sig_dev 将被react-native移除的ViewPropTypes, ColorPropType更改补丁包 — committed to He0Jiao/react-native-switch-pro by He0Jiao 3 years ago
toggleDayAvailabilitybasically just sends a request to the server to update that field’s value.The switches that aren’t making any server calls in the
onSyncPressare working perfectly, but this particular one looks to be getting updated with new props which causes the animation to happen twice.