Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
simple-redux-form
Advanced tools
Higher order component for React Redux forms (inspired by redux-form)
Idea of this library is 100% inspired from redux-form (v5).
This library is subset of redux-form for small / few forms. If your application is form heavey with large / complex form please use redux-form.
I have implemented this libray for following reasons :-
redux-from
redux-form
.$ npm install --save simple-redux-form
The first thing, you have to mount simple-redux-form
reducer to your redux reducers.
Configure this inside your rootReducers.
import {reducer as simpleFormReducer} from 'simple-redux-form';
const reducers = {
// your other reducers
form: simpleFormReducer
}
You need to decorate your component with simpleReduxForm.
import simpleReduxForm from 'simple-redux-form'
const fields = ['firstName', 'lastName'];
function validate(values) {
const errors = {};
if (!values.firstName) {
errors.firstName = 'Required';
}
if (!values.lastName) {
errors.lastName = 'Required';
}
return errors;
}
const MyNewForm = ({ fields: {firstName, lastName } }) => (
<form>
<input {...firstName} />
<input {...lastName} />
</form>
)
export default simpleReduxForm({
fields: fields,
validate: validate,
})(MyNewForm)
Each field in the fields prop contains the value
a onChange
, error
, touched
as sugger props to each field.
You can also pass fields as props.
For custom Input components this library expose , setValue
function with each field for setting vlaues manually.
MIT
FAQs
This is simplest redux form
The npm package simple-redux-form receives a total of 4 weekly downloads. As such, simple-redux-form popularity was classified as not popular.
We found that simple-redux-form 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
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.