Security News
NVD Backlog Tops 20,000 CVEs Awaiting Analysis as NIST Prepares System Updates
NVD’s backlog surpasses 20,000 CVEs as analysis slows and NIST announces new system updates to address ongoing delays.
disposable-component
Advanced tools
A simple reactive API for mounting and unmounting components to the DOM
Disposable-component providse a simple reactive API for mounting and unmounting components to the DOM. This is useful for cross framework interop inside your single-page-app.
npm install --save disposable-component
A simple example would be to use disposable-component
to build a
react-modal:
import React from "react";
import ReactDOM from "react-dom";
import mountComponent from "disposable-component";
function showModal(El, props) {
return mountComponent(
function mount(next, complete, error) {
el = document.createElement("div");
document.body.appendChild(el);
ReactDOM.render(
<El {...props} close={complete} next={next} />,
el
);
},
function unmount() {
ReactDOM.unmountComponentAtNode(el);
el.parentNode.removeChild(el);
}
);
}
const subscription = showModal(function MyModal() {
return (
<div>
<h1>My Modal</h1>
<button onClick={this.props.complete}>Close</button>
<button onClick={this.props.next.bind(null, 1)}>Save</button>
</div>
);
}).subscribe(
data => console.log(data),
err => console.error(err)
);
subscription.unsubscribe(); // close the modal
FAQs
A simple reactive API for mounting and unmounting components to the DOM
We found that disposable-component demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 11 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
NVD’s backlog surpasses 20,000 CVEs as analysis slows and NIST announces new system updates to address ongoing delays.
Security News
Research
A malicious npm package disguised as a WhatsApp client is exploiting authentication flows with a remote kill switch to exfiltrate data and destroy files.
Security News
PyPI now supports digital attestations, enhancing security and trust by allowing package maintainers to verify the authenticity of Python packages.