Product
Introducing SSO
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
react-expire
Advanced tools
Changelog
1.0.0 / 2019-01-27
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
FAQs
React component for managing time expiration
The npm package react-expire receives a total of 57 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 because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.