
Security News
npm Adopts OIDC for Trusted Publishing in CI/CD Workflows
npm now supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.
react-proxy
Advanced tools
Work in progress.
Generic React component proxy.
A future engine for React Hot Loader.
Intended to be used from hot reloading tools like React Hot Loader.
If you’re an application developer, it’s unlikely you’ll want to use it directly.
import React, { Component } from 'react';
class ComponentVersion1 extends Component {
render() {
return <div>Before hot update.</div>;
}
}
class ComponentVersion2 extends Component {
render() {
return <div>After hot update.</div>;
}
}
Without React Proxy:
const rootEl = document.getElementById('root');
React.render(<ComponentVersion1 />, rootEl);
React.render(<ComponentVersion2 />, rootEl); // will reset state and kill DOM :-(
With React Proxy:
import { createProxy, getForceUpdate } from 'react-proxy';
const proxy = createProxy(ComponentVersion1);
const Proxy = proxy.get();
React.render(<Proxy />, rootEl);
// will update the mounted instances' prototypes:
// both DOM and state are perserved.
const mountedInstances = proxy.update(ComponentVersion2);
// works with React Native and non-Component descendants
const forceUpdate = getForceUpdate(React);
mountedInstances.forEach(forceUpdate);
MIT
FAQs
Proxies React components without unmounting or losing their state.
The npm package react-proxy receives a total of 118,555 weekly downloads. As such, react-proxy popularity was classified as popular.
We found that react-proxy 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
npm now supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.
Research
/Security News
A RubyGems malware campaign used 60 malicious packages posing as automation tools to steal credentials from social media and marketing tool users.
Security News
The CNA Scorecard ranks CVE issuers by data completeness, revealing major gaps in patch info and software identifiers across thousands of vulnerabilities.