Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Summary: Set the initial opacity based on the style opacity instead of defaulting to 1. Without this change, if the opacity on the view is set to 0.5 (for example), the component will render with 1 opacity and then after a press and release it will set to 0.5. This fixes it to set to the correct value on mount. **Test plan (required)** Example code: ``` <TouchableOpacity activeOpacity={1} style={STYLES.Button}> {...} </TouchableOpacity> ``` ``` const STYLES = StyleSheet.create({ Button: { opacity: 0.5, }, }); ``` Before (notice starts out dark and then after click and release becomes light): ![before](https://cloud.githubusercontent.com/assets/19673711/23444255/c120cbb0-fde8-11e6-8c03-ef4f0f25736b.gif) After (starts out light and is the same light color after a click and release): ![after](https://cloud.githubusercontent.com/assets/19673711/23444254/c106a6e0-fde8-11e6-8181-def45b7bb84f.gif) Closes #12628 Differential Revision: D4641509 fbshipit-source-id: 3b6cf653fe837df704007f585c655d4450d14497
- Loading branch information