react-expire
Advanced tools
React component for managing time expiration
Weekly downloads
Changelog
1.0.2 / 2019-12-23
Readme
React component for managing time expiration.
Sometimes, we need to show something, and after, remove this thing. The simpliest case - notification that must disappear after some time.
# with NPM
npm install react-expire --save
# or YARN
yarn install react-expire
react-expire
component accepts such props:
onExpire
property will be triggered.onExpire
will be called without any params.You can use this component in different ways:
As component with(out) children that passes expire event in parent component via callback
<Expire until={2000} id={1} onExpire={someParentComponentHandler}>
<ChildComponent />
</Expire>
As render-prop
<Expire until={2000}>
{(expired) => (
expired ? 'Expired' : 'Not yet expired'
)}
</Expire>
NOTE: You can use together render-prop pattern and callback function.
npm run build
npm run example
React component for managing time expiration
The npm package react-expire receives a total of 87 weekly downloads. As such, react-expire popularity was classified as not popular.
We found that react-expire demonstrated a not healthy version release cadence and project activity. It has 1 open source maintainer collaborating on the project.