Skip to content

Commit

Permalink
opacity in TouchableOpacity properly react to state change
Browse files Browse the repository at this point in the history
  • Loading branch information
hetanthakkar committed Jan 23, 2022
1 parent 48f6967 commit 949086d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Libraries/Components/Touchable/TouchableOpacity.js
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,10 @@ class TouchableOpacity extends React.Component<Props, State> {

componentDidUpdate(prevProps: Props, prevState: State) {
this.state.pressability.configure(this._createPressabilityConfig());
if (this.props.disabled !== prevProps.disabled) {
if (
this.props.disabled !== prevProps.disabled ||
this.props.style.opacity !== prevProps.style.opacity
) {
this._opacityInactive(250);
}
}
Expand Down

0 comments on commit 949086d

Please sign in to comment.