Skip to content

[Feature]: Implement useTapAway #7

@gaoachao

Description

@gaoachao

What problem does this feature solve?

Implementation of useClickAway on Lynx

What does the proposed API of configuration look like?

import { useRef } from '@lynx-js/react';
import { useTapAway } from '@lynx-js/react-use';

const Demo = () => {
  const ref = useRef(null);

  useTapAway(ref, () => {
    console.log('OUTSIDE TAP');
  });

  return (
    <view ref={ref} style={{
      width: 200,
      height: 200,
      background: 'red',
    }} />
  );
};

Metadata

Metadata

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions