
Research
/Security News
Critical Vulnerability in NestJS Devtools: Localhost RCE via Sandbox Escape
A flawed sandbox in @nestjs/devtools-integration lets attackers run code on your machine via CSRF, leading to full Remote Code Execution (RCE).
react-portal-minimal
Advanced tools
React-Portal-Minimal is a minimalistic version of React-Portal.
Compared to React-Portal, it is less than 1/3 the size, has minimal options, and no state.
It is intended as a building block. It does only three things:
className
on the subtree root.className
on the subtree root if it changes.npm install react react-dom react-portal-minimal --save
react-portal | react-portal-minimal | |
---|---|---|
require() size | 7.3kB | 3.7kB |
tarball size | 450kB | 4.2kB |
import React from 'react';
import ReactDOM from 'react-dom';
import Portal from 'react-portal-minimal';
export default class App extends React.Component {
render() {
const button1 = <button>Open portal with pseudo modal</button>;
return (
<Portal>
<PseudoModal>
<h2>Pseudo Modal</h2>
<p>This react component is appended to the document body.</p>
</PseudoModal>
</Portal>
);
}
}
export class PseudoModal extends React.Component {
render() {
return (
<div>
{this.props.children}
<p><button onClick={this.props.closePortal}>Close this</button></p>
</div>
);
}
}
ReactDOM.render(<App />, document.getElementById('react-body'));
The portal expects one child (<Portal><Child ... /></Portal>
) that will be ported.
A className to apply to the new React tree's root.
Please, create issues and pull requests.
git clone https://github.com/strml/react-portal-minimal
cd react-portal-minimal
npm install
npm start
open http://localhost:3000
Don't forget to run this before every commit:
npm test
This project is based on @tajo's react-portal.
FAQs
React component used to hoist components to a new subtree.
We found that react-portal-minimal 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.
Research
/Security News
A flawed sandbox in @nestjs/devtools-integration lets attackers run code on your machine via CSRF, leading to full Remote Code Execution (RCE).
Product
Customize license detection with Socket’s new license overlays: gain control, reduce noise, and handle edge cases with precision.
Product
Socket now supports Rust and Cargo, offering package search for all users and experimental SBOM generation for enterprise projects.