react flash change
1.0.0
变更道具上的闪光容器
这是一个示例页面。
./storybook中有消息来源
# Yarn
yarn add @avinlab/react-flash-change
# NPM
npm install --save @avinlab/react-flash-change import React from 'react' ;
import FlashChange from '@avinlab/react-flash-change' ;
const Component = ( { value } ) => {
< FlashChange
value = { value }
flashClassName = "flashing"
compare = { ( prevProps , nextProps ) => {
return nextProps . value !== prevProps . value ;
} }
>
< span > { value } </ span >
</ FlashChange > ;
} ; | 财产 | 类型 | 必需的? | 描述 |
|---|---|---|---|
| 比较 | 功能 | 功能以比较更新之前和之后的道具以解决是否闪烁。函数参数:( (prevProps, nextProps) 。默认情况下它比较props.value 。如果返回字符串 - 将是Flash className。 | |
| 闪存 | 数字 | MS中“闪存”效应的持续时间。默认值:200ms | |
| FlashClassName | 细绳 | flash-effect className | |
| 闪存 | 目的 | 闪存效应样式对象 | |
| className | 细绳 | 可选的自定义CSS班级名称 | |
| 风格 | 目的 | 可选的内联样式 | |
| OuterelementType | React $ ementhType | 标记名称传递给了document.createelement以创建外部容器元素。默认: div |
麻省理工学院©Avin