
Security News
The Hidden Blast Radius of the Axios Compromise
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.
react-link-state
Advanced tools
A helper function to use LinkedStateMixin for ES6 React Components.
Note: This might be deprecated soon as there are plans to deprecate ReactLink (#2302).
npm install react-link-state --save
import React from 'react';
import linkState from 'react-link-state';
export default MyForm extends React.Component {
constructor(props) {
super(props);
this.state = {
username: '',
password: '',
toggle: false
};
}
render() {
console.log(this.state);
return (
<form>
<input type="text" valueLink={linkState(this, 'username')} />
<input type="password" valueLink={linkState(this, 'password')} />
<input type="checkbox" checkedLink={linkState(this, 'toggle')}
</form>
);
}
}
Note: Use checkedLink for checkboxes.
Deep link-state is also supported!
// Given that we have this state:
// {
// users: [{
// profile: {
// first_name: ''
// }
// }]
// }
<input type="text" valueLink={linkState(this, 'users.0.profile.first_name')} />
npm test
You need node v4.0.0 to runs the tests. See issue.
You will need to have window, window.document and window.document.createElement globally available before you import React. Otherwise React will think it can't access the DOM and methods like setState won't work.
FAQs
A helper util to use LinkedStateMixin for ES6
The npm package react-link-state receives a total of 62 weekly downloads. As such, react-link-state popularity was classified as not popular.
We found that react-link-state 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
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.

Research
Malicious versions of the Telnyx Python SDK on PyPI delivered credential-stealing malware via a multi-stage supply chain attack.