{"id":16052192,"url":"https://github.com/gregnb/jsonreactor","last_synced_at":"2025-06-23T18:33:35.048Z","repository":{"id":57285858,"uuid":"104833306","full_name":"gregnb/jsonreactor","owner":"gregnb","description":"Transform simple or nested JSON objects during run time into React Components ","archived":false,"fork":false,"pushed_at":"2017-11-04T18:36:52.000Z","size":11,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-07T14:53:08.190Z","etag":null,"topics":["javascript","json","nested-json-objects","react"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gregnb.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-09-26T03:50:03.000Z","updated_at":"2019-02-18T11:25:15.000Z","dependencies_parsed_at":"2022-09-20T00:20:49.511Z","dependency_job_id":null,"html_url":"https://github.com/gregnb/jsonreactor","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gregnb%2Fjsonreactor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gregnb%2Fjsonreactor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gregnb%2Fjsonreactor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gregnb%2Fjsonreactor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gregnb","download_url":"https://codeload.github.com/gregnb/jsonreactor/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gregnb%2Fjsonreactor/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259123865,"owners_count":22808876,"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":["javascript","json","nested-json-objects","react"],"created_at":"2024-10-09T01:07:58.010Z","updated_at":"2025-06-23T18:33:35.015Z","avatar_url":"https://github.com/gregnb.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n  \u003cimg src=\"https://user-images.githubusercontent.com/19170080/30990752-688690d2-a470-11e7-990e-3f39105a58bf.jpg\" /\u003e\n\u003c/div\u003e\n\n# JSON Reactor - JSON to REACT\n\n[![Build Status](https://travis-ci.org/gregnb/jsonreactor.svg?branch=master)](https://travis-ci.org/gregnb/jsonreactor)\n[![dependencies Status](https://david-dm.org/gregnb/jsonreactor/status.svg)](https://david-dm.org/gregnb/jsonreactor)\n[![npm version](https://badge.fury.io/js/jsonreactor.svg)](https://badge.fury.io/js/jsonreactor)\n\nTransform simple or nested JSON objects during run time into React Components \n\n\n## Install\n\n`npm install jsonreactor --save-dev `\n\n## Demo\n\n[![Edit jsonreactor](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/s/1qxj58vnpl)\n\n## Usage\n\nInside of your React component, after you recieve your JSON payload you can transform them into React components in the following manner:\n\n#### Step 1: Define your Component map\n```js\n\nimport ParaGraph from \"./yourComponentLibrary/ParaGraph\";\nimport { OrderedList, ListItem } from \"./yourComponentLibrary/OrderedList\";\n\nconst componentTable = {\n  paragraph: ParaGraph,\n  orderedlist: OrderedList,\n  listitem: ListItem\n};\n\n```\n\n#### Step 2: Call JSONReactor component\n\nNow pass your object data to JSONReactor along with the componentTable mapping. For example, say you received JSON that looked like this object:\n\n```js\nconst jsonObject = {\n  paragraph: {\n    content: \"here is some content to display!\"\n  },\n  orderedlist: [\n    {\n      listitem: {\n        content: \"test #1\"\n      }\n    },\n    {\n      listitem: {\n        content: \"test #2\"\n      }\n    },\n    {\n      listitem: {\n        content: \"test #3\"\n      }\n    }\n  ]\n};\n```\n\nYou can now call JSONReactor:\n\n```js\nclass JSONReactorExample extends React.Component {\n  render() {\n    return \u003cJSONReactor data={jsonObject} components={componentTable} /\u003e;\n  }\n}\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgregnb%2Fjsonreactor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgregnb%2Fjsonreactor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgregnb%2Fjsonreactor/lists"}