Skip to content

Commit

Permalink
fix: handle onClick and onPress both
Browse files Browse the repository at this point in the history
  • Loading branch information
hosseinmd committed Nov 25, 2021
1 parent f17002d commit fbab979
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/component/src/atoms/view/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,10 @@ const View = forwardRef<HTMLDivElement, ViewProps>(

const handleClick = React.useCallback(
(e) => {
if (onClick != null) {
if (onClick) {
onClick(e);
} else if (onPress != null) {
}
if (onPress) {
e.stopPropagation();
onPress(e);
}
Expand Down

0 comments on commit fbab979

Please sign in to comment.