shallinta / react-hook-use-animation

A custom react hook to create a status of react component animation. And a custom Modal component based on `useAnimation` hook.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

A custom react hook: useAnimation

package

A custom react hook to create a status of react component animation.
And a custom Modal component based on useAnimation hook.

基于react-hooks实现的自定义css动画hook: useAnimation。以及基于useAnimation实现的带进入和离开动画的Modal组件。

效果预览

Preview:

wait to complete. (codesandbox.com)

代码

Code:

源码(source code):/hooks/use-animation.js
用例(usage):/components/modal/index.js

注意

Note that:
This hook is based on at least react@16.7.0-alpha.
This component style is based on postcss-preset-env.

  • 本hook至少基于react@16.7.0-alpha版本,也就是需要支持react-hooks的版本。
  • 本Modal组件的样式基于postcss-preset-env插件。

About

A custom react hook to create a status of react component animation. And a custom Modal component based on `useAnimation` hook.

License:MIT License


Languages

Language:JavaScript 84.5%Language:CSS 15.5%