{"id":14384974,"url":"https://github.com/mihirsoni/simple-redux-form","last_synced_at":"2025-04-11T11:10:38.745Z","repository":{"id":57360779,"uuid":"65145088","full_name":"mihirsoni/simple-redux-form","owner":"mihirsoni","description":"This simple redux form a tiny alternative for redux-form","archived":false,"fork":false,"pushed_at":"2017-02-15T08:44:05.000Z","size":13,"stargazers_count":11,"open_issues_count":0,"forks_count":3,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-25T07:36:09.770Z","etag":null,"topics":["forms","react","reactforms","redux","redux-form"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mihirsoni.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-08-07T17:15:46.000Z","updated_at":"2023-03-10T10:18:56.000Z","dependencies_parsed_at":"2022-09-06T22:20:57.460Z","dependency_job_id":null,"html_url":"https://github.com/mihirsoni/simple-redux-form","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mihirsoni%2Fsimple-redux-form","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mihirsoni%2Fsimple-redux-form/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mihirsoni%2Fsimple-redux-form/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mihirsoni%2Fsimple-redux-form/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mihirsoni","download_url":"https://codeload.github.com/mihirsoni/simple-redux-form/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248381791,"owners_count":21094528,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["forms","react","reactforms","redux","redux-form"],"created_at":"2024-08-28T18:01:49.713Z","updated_at":"2025-04-11T11:10:38.713Z","avatar_url":"https://github.com/mihirsoni.png","language":"JavaScript","funding_links":[],"categories":["JavaScript","Marks"],"sub_categories":["[React - A JavaScript library for building user interfaces](http://facebook.github.io/react)"],"readme":"\u003ch1 align=\"center\"\u003eSimplest Redux Form\u003c/h1\u003e\n\n\u003e Higher order component for React Redux forms (inspired by [redux-form](https://github.com/erikras/redux-form))\n\n## Note \n\nIdea of this library is 100% inspired from [redux-form](https://github.com/erikras/redux-form) (v5).\n\nThis library is subset of [redux-form](https://github.com/erikras/redux-form) for small / few forms.\nIf your application is form heavey with large / complex form please use [redux-form](https://github.com/erikras/redux-form).\n\nI have implemented this libray for following reasons :- \n\n* [redux-form](https://github.com/erikras/redux-form) is great way of managing forms within application with react and redux.\n* For small forms using large library will add up unnecessary bundle size increase, this library focus on simple and small version of `redux-from`\n* Scope of this library will be very minimal, if you want full fledge library please use `redux-form`.\n\n## Installation\n\n```\n$ npm install --save simple-redux-form\n```\n\n## Usage\n\n### Step #1\n\nThe first thing, you have to mount `simple-redux-form` reducer to your redux reducers.\nConfigure this inside your rootReducers.\n\n```js\nimport {reducer as simpleFormReducer} from 'simple-redux-form';\nconst reducers = {\n  // your other reducers\n  form: simpleFormReducer  \n}\n```\n\n### Step #2\n\nYou need to decorate your component with simpleReduxForm.\n\n```js\nimport simpleReduxForm from 'simple-redux-form'\nconst fields = ['firstName', 'lastName'];\nfunction validate(values) {\n  const errors = {};\n  if (!values.firstName) {\n    errors.firstName = 'Required';\n  }\n  if (!values.lastName) {\n    errors.lastName = 'Required';\n  }\n  return errors;\n}\n\nconst MyNewForm = ({ fields: {firstName, lastName } }) =\u003e (\n  \u003cform\u003e\n    \u003cinput {...firstName} /\u003e\n    \u003cinput {...lastName} /\u003e\n  \u003c/form\u003e\n)\n\nexport default simpleReduxForm(MyForm, { \n  form: 'test'\n  fields, \n  validate,\n});\n\n```\n\nEach field in the fields prop contains the `value` a `onChange`, `error` , `touched` as sugger props to each field.\n\nYou can also pass fields as props.\n\nFor custom Input components this library expose , `setValue` function with each field for setting vlaues manually.\n\n\n### Todo\n\n* [ ] Docs\n* [ ] Examples\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmihirsoni%2Fsimple-redux-form","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmihirsoni%2Fsimple-redux-form","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmihirsoni%2Fsimple-redux-form/lists"}