Skip to content

Extended react hook for Josh Comeau's boop effect

Notifications You must be signed in to change notification settings

remziatay/use-boop

Repository files navigation

use-boop

Extended react hook for Josh Comeau's boop effect

NPM

Install

npm install --save react-spring use-boop

Usage

import useBoop from 'use-boop';
import { animated } from 'react-spring';

const SomeComponent = () => {
  const [style, trigger] = useBoop({ rotation: 45 });

  return (
    <animated.div style={style} onMouseEnter={trigger}>
      {/* Child can be anything */}
      <AiOutlineQuestionCircle size={80} />
    </animated.div>
  );
};