
Security News
Node.js Drops Bug Bounty Rewards After Funding Dries Up
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.
react-async-modal
Advanced tools
A simple tool for creating modals with Promise style usage based on react-responsive-modal
yarn add react-async-modalnpm i react-async-modal --save// Importing
import asyncModal from 'react-async-modal';
import 'react-responsive-modal/styles.css';
// Setup default modal settings (optional)
asyncModal.setDefaultModalProps({
showCloseIcon: false,
style: {
modal: {
width: 500
}
}
});
// Defining modal component
class MyConfirm extends React.Component<{question: string, resolve(boolean): void, close(): void}> {
render() {
return <div>
<h1>{this.props.question}</h1>
<button onClick={()=>this.props.resolve(true)}>Confirm</button>
<button onClick={()=>this.props.close()}>Close</button>
</div>
}
}
// Calling modal with async/await style
const result = await asyncModal(MyConfirm, { question: 'Delete file?' }, { showCloseIcon: false });
console.log(result);
// Or with Promise style
asyncModal(MyConfirm, { question: 'Delete file?' }, { showCloseIcon: false }).then((payload) => {
if(payload) {
console.log('File was deleted!');
}
});
There are two methods will be injected to props of MyConfirm component:
resolve method to send payload and close modalclose method to send null as payload and close modalUse modalProps argument or asyncModal.setDefaultModalProps() method to pass props to react-responsive-modal
Available props: https://react-responsive-modal.leopradel.com/#props
FAQs
React Async Modal
We found that react-async-modal demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers 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.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.

Security News
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.

Research
A supply chain attack on Axios introduced a malicious dependency, plain-crypto-js@4.2.1, published minutes earlier and absent from the project’s GitHub releases.