{"id":20355601,"url":"https://github.com/geekeast/react-props-key","last_synced_at":"2026-03-07T12:03:30.487Z","repository":{"id":124183043,"uuid":"256778688","full_name":"GeekEast/react-props-key","owner":"GeekEast","description":"Reset children component state when some parts of parent components changes","archived":false,"fork":false,"pushed_at":"2020-04-18T14:50:05.000Z","size":3,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-31T06:48:28.521Z","etag":null,"topics":["react-key"],"latest_commit_sha":null,"homepage":"https://codesandbox.io/s/github/GeekEast/react-props-key","language":"HTML","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/GeekEast.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-04-18T14:50:00.000Z","updated_at":"2020-04-18T14:51:15.000Z","dependencies_parsed_at":null,"dependency_job_id":"4898fc26-d483-49f8-bdb2-2950c222afdb","html_url":"https://github.com/GeekEast/react-props-key","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/GeekEast/react-props-key","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GeekEast%2Freact-props-key","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GeekEast%2Freact-props-key/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GeekEast%2Freact-props-key/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GeekEast%2Freact-props-key/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/GeekEast","download_url":"https://codeload.github.com/GeekEast/react-props-key/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GeekEast%2Freact-props-key/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30212491,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-07T09:02:10.694Z","status":"ssl_error","status_checked_at":"2026-03-07T09:02:08.429Z","response_time":53,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["react-key"],"created_at":"2024-11-14T23:13:26.054Z","updated_at":"2026-03-07T12:03:25.475Z","avatar_url":"https://github.com/GeekEast.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"### Needs\n\n- Parent components pass default value of state into children component\n- state management is handled by the children component ( uncontrolled )\n- **when some parts of state in parent component changes, the children component can be `reset`**\n\n### key\n\n- simply `key=\u003csome_parts_of_state_in_parent\u003e`\n\n\u003e When a key changes, React will create a `new component instance` rather than **update** the existing one.\n\n```javascript\nclass EmailInput extends Component {\n  state = { email: this.props.defaultEmail };\n\n  handleChange = event =\u003e {\n    this.setState({ email: event.target.value });\n  };\n\n  render() {\n    return \u003cinput onChange={this.handleChange} value={this.state.email} /\u003e;\n  }\n}\n\n\u003cEmailInput defaultEmail={this.props.user.email} key={this.props.user.id} /\u003e;\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgeekeast%2Freact-props-key","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgeekeast%2Freact-props-key","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgeekeast%2Freact-props-key/lists"}