
Security News
Axios Supply Chain Attack Reaches OpenAI macOS Signing Pipeline, Forces Certificate Rotation
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.
react-liberator
Advanced tools
Enables React component to render its DOM away from its siblings.
This is the foundation for building a proper windowing system.
http://dkozar.github.io/react-liberator/
// ES6
import React, { Component } from 'react';
import ReactDOM from 'react-dom';
import { Button } from 'react-bootstrap';
import Liberator from './Liberator';
export class App extends Component {
constructor(props) {
super(props);
this.state = {
text: 'I\'m rendered in an overlay'
};
}
render() {
return (
<div>
<Button>The sibling</Button>
<Liberator>
<div>{this.state.text}</div>
</Liberator>
</div>
);
}
}
render(<App />, document.body);
Or use it as a switch:
<Liberator active={this.state.active}>
<div>Popup</div>
</Liberator>
Or render it to the predefined element:
<Liberator layerId="foo">
<div>Popup</div>
</Liberator>
<div id="foo"></div>
Use callbacks:
<Liberator onActivate={function(e) {console.log('onActivate', e)}}
onDeactivate={function(arg) {console.log('onDeactivate', e)}}>
<div>Popup</div>
</Liberator>
These callbacks are being executed with an object as argument:
{
layer: // the layer to which liberated components are rendered to (multiple Liberators could render into the same layer)
wrapper: // wrapper element for component rendered by THIS Liberator
children: // original children provided to THIS Liberator
}
npm install react-liberator --save
This will install the package into the node_modules folder of your project.
git clone https://github.com/dkozar/react-liberator.git
cd react-liberator
npm install
npm install will install all the dependencies (and their dependencies) into the node_modules folder.
Then, you should run one of the builds.
npm start
open http://localhost:3000
This will give you the build that will partially update the browser via webpack whenever you save the edited source file.
Additionally, it will keep the React component state intact.
For more info on React hot-loader, take a look into this fantastic video.
npm run demo
This should build the minified demo folder (it's how the demo is built).
npm run debug
This should build the non-minified demo folder (for easier debugging).
You could install the http-server for running demo builds in the browser:
npm install http-server
http-server
npm run build
Runs Babel on source files (converting ES6 and React to JS) and puts them into the build folder.
npm run dist
Builds the webpackUniversalModuleDefinition and puts it into the dist folder.
npm run all
Runs all the builds: build + dist + demo.
:rocket: React Transform Boilerplate for the workflow.


FAQs
Allows React component to be rendered away from its siblings
We found that react-liberator 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.

Security News
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.

Security News
Open source is under attack because of how much value it creates. It has been the foundation of every major software innovation for the last three decades. This is not the time to walk away from it.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.