Skip to content

Commit

Permalink
fixed PressableWithFeedback props
Browse files Browse the repository at this point in the history
  • Loading branch information
Skalakid committed Jun 22, 2023
1 parent 2b2f497 commit 1b215f6
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/components/Pressable/PressableWithFeedback.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import GenericPressablePropTypes from './GenericPressable/PropTypes';
import OpacityView from '../OpacityView';
import variables from '../../styles/variables';

const omittedProps = ['wrapperStyle', 'onHoverIn', 'onHoverOut', 'onPressIn', 'onPressOut'];
const omittedProps = ['wrapperStyle'];

const PressableWithFeedbackPropTypes = {
...GenericPressablePropTypes.pressablePropTypes,
Expand Down Expand Up @@ -38,7 +38,7 @@ const PressableWithFeedbackDefaultProps = {
};

const PressableWithFeedback = forwardRef((props, ref) => {
const rest = _.omit(props, omittedProps);
const propsWithoutWrapperStyles = _.omit(props, omittedProps);
const [disabled, setDisabled] = useState(props.disabled);
const [isPressed, setIsPressed] = useState(false);
const [isHovered, setIsHovered] = useState(false);
Expand All @@ -55,6 +55,8 @@ const PressableWithFeedback = forwardRef((props, ref) => {
>
<GenericPressable
ref={ref}
// eslint-disable-next-line react/jsx-props-no-spreading
{...propsWithoutWrapperStyles}
disabled={disabled}
onHoverIn={() => {
setIsHovered(true);
Expand Down Expand Up @@ -85,8 +87,6 @@ const PressableWithFeedback = forwardRef((props, ref) => {
});
});
}}
// eslint-disable-next-line react/jsx-props-no-spreading
{...rest}
>
{(state) => (_.isFunction(props.children) ? props.children(state) : props.children)}
</GenericPressable>
Expand Down

0 comments on commit 1b215f6

Please sign in to comment.