Simple component that unmounts a component after a given delay.
npm install react-flash-messageSimple component that unmounts a component after a given delay. It adds no styling or animations, you can use other components like react-transition-group for that.
``jsx
import React from 'react';
import { render } from 'react-dom';
import FlashMessage from 'react-flash-message'
const Message = () => (
I will disapper in 5 seconds!
)
render(Message, document.body);
`
`jsx
import FlashMessage from 'react-flash-message';
// inside render Message
`
| Prop | Type | Default | Description |
| ---------------- | ------ | ------- | ---------------------------------------------------------------- |
| duration | number | 5000 | Number of milliseconds the component will show |persistOnHover` | bool | true | Will not remove the component when the user hovers on it if true |
|
Feel free to contribute. Submit a Pull Request or open an issue for further discussion.
MIT