Skip to content

Commit

Permalink
pass boolean always instead of optional prop
Browse files Browse the repository at this point in the history
  • Loading branch information
aimane-chnaif committed May 14, 2023
1 parent d5aee38 commit b715025
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions src/components/OpacityView.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const propTypes = {
/**
* Should we dim the view
*/
shouldDim: PropTypes.bool,
shouldDim: PropTypes.bool.isRequired,

/**
* Content to render
Expand All @@ -31,7 +31,6 @@ const propTypes = {
};

const defaultProps = {
shouldDim: false,
style: [],
dimmingValue: variables.hoverDimValue,
};
Expand Down
2 changes: 1 addition & 1 deletion src/components/Pressable/PressableWithFeedback.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ const PressableWithFeedback = forwardRef((props, ref) => {
>
{(state) => (
<OpacityView
shouldDim={!disabled && (state.pressed || state.hovered)}
shouldDim={Boolean(!disabled && (state.pressed || state.hovered))}
dimmingValue={state.pressed ? props.pressDimmingValue : props.hoverDimmingValue}
style={[
...StyleUtils.parseStyleFromFunction(props.style, state),
Expand Down

0 comments on commit b715025

Please sign in to comment.