🌐
Carlosnz
carlosnz.github.io › json-edit-react
JSON•Edit•React
A highly-configurable React component for editing or viewing JSON/object data
🌐
npm
npmjs.com › package › jsoneditor-react
jsoneditor-react - npm
const JsonEditor = importedComponent(() => Promise.all([ import(/* webpackChunkName:'jsoneditor' */'jsoneditor-react'), import(/* webpackChunkName:'jsoneditor' */'brace'), import(/* webpackChunkName:'jsoneditor' */'ajv'), import(/* webpackChunkName:'jsoneditor' */'brace/mode/json'), import(/* webpackChunkName:'jsoneditor' */'brace/theme/github') ]).then(([{ JsonEditor: Editor }, ace, Ajv ]) => { const ajv = new Ajv(); return function EditorHoc(props) { return ( <Editor ace={ace} ajv={ajv} theme="ace/theme/github" {...props} /> ); } }));
      » npm install jsoneditor-react
    
Published   Dec 17, 2021
Version   3.1.2
Author   Ivan Kopeykin
🌐
GitHub
github.com › CarlosNZ › json-edit-react
GitHub - CarlosNZ/json-edit-react: React component for editing/viewing JSON/object data · GitHub
However, you can offer a more sophisticated text/code editor by passing the component into the TextEditor prop. Your component must provide the following props for json-edit-react to use: ... onKeyDown: (e: React.KeyboardEvent) => void — should be called on every keystroke to detect "Accept"/"Cancel" keys · You can see an example in the demo where I have implemented CodeMirror when the "Custom Text Editor" option is checked.
Starred by 616 users
Forked by 37 users
Languages   TypeScript 86.8% | CSS 5.5% | Python 4.1% | JavaScript 3.4% | HTML 0.2%
🌐
CodeSandbox
codesandbox.io › examples › package › jsoneditor-react
jsoneditor-react examples - CodeSandbox
editor json · amanjotsinghdhunna · seveibar/react-watertable · application-viewer · kryaksy · application-viewer · IlyaGershman/funFsm-reactuseMachine hook example · node-editor · rn-config-tyler-lib[![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/applerdotxyz/rn-config-tyler) rn-composable ·
🌐
GitHub
github.com › sujinleeme › react-json-editor
sujinleeme/react-json-editor: 🖌 A simple JSON online editor
Visit to https://json-studio.vercel.app · Git clone this repo and run yarn && yarn start. As the initialization process is supposed to load some scripts from CDN, there is a problem with Jest (and other testing tools). It only shows "Loading..." and never gets the editor working in the test. See : suren-atoyan/monaco-react#88 ·
Starred by 151 users
Forked by 21 users
Languages   TypeScript 55.2% | JavaScript 40.0% | HTML 3.1% | CSS 1.7%
🌐
npm
npmjs.com › package › json-edit-react
json-edit-react - npm
import { JsonEditor } from 'json-edit-react' // In your React component: return ( <JsonEditor data={ jsonData } setData={ setJsonData } // optional { ...otherProps } /> ); (for end user) It's pretty self explanatory (click the "edit" icon to edit, etc.), but there are a few not-so-obvious ways of interacting with the editor: Double-click a value (or a key) to edit it ·
      » npm install json-edit-react
    
Published   Oct 01, 2025
Version   1.29.0
Author   Carl Smith
🌐
GitHub
github.com › ismaelga › react-json-editor
GitHub - ismaelga/react-json-editor: A dynamic form component for react using JSON-Schema.
The full code for the demo can be found at https://github.com/ismaelga/react-json-editor/blob/master/demos/demo.jsx.
Starred by 230 users
Forked by 42 users
Languages   JavaScript 97.8% | Shell 1.8% | HTML 0.4% | JavaScript 97.8% | Shell 1.8% | HTML 0.4%
🌐
Bytescrum
blog.bytescrum.com › how-to-use-jsoneditor-in-a-react-app
How to Use JSONEditor in a React App
March 29, 2024 - Here's a basic example: import React, { useState, useEffect, useRef } from 'react'; import JSONEditor from 'jsoneditor'; const App = () => { const [jsonData, setJsonData] = useState(null); const editorRef = useRef(null); useEffect(() => { if ...
Find elsewhere
🌐
DhiWise
dhiwise.com › post › mastering-jsoneditor-react-for-efficient-data-manipulation
Mastering JSONEditor React: A Comprehensive Guide
October 25, 2023 - The JsonEditor component is imported asynchronously in this example using the React.lazy() technique. While the JsonEditor component is loading, the Suspense component displays a loading message. JSONEditor React provides built-in support for syntax checking, which can be very helpful for debugging JavaScript object syntax. If the JSON data passed to the JSONEditor component is not valid JSON, the editor will highlight the syntax error and display an error message.
🌐
Tim Santeford
timsanteford.com › posts › building-a-custom-json-editor-in-react-with-and-without-react-json-view
Building a Custom JSON Editor in React with and without react-json-view - Tim Santeford
While libraries like react-json-view ... this blog post, I’ll walk you through how to build a JSON editor in React using both react-json-view and a custom implementation. We’ll use TypeScript for our code examples to ensure type safety and better development practice...
🌐
GitHub
github.com › vankop › jsoneditor-react
GitHub - vankop/jsoneditor-react: react wrapper implementation for https://github.com/josdejong/jsoneditor
render() { return ( <Editor value={yourJson} onChange={this.handleChange} theme="ace/theme/github" schema={yourSchema} /> ); } ... If you using webpack and es6 dynamic imports you can load jsoneditor-react asynchronously.
Starred by 277 users
Forked by 107 users
Languages   JavaScript 99.8% | CSS 0.2% | JavaScript 99.8% | CSS 0.2%
🌐
Replit Docs
docs.replit.com › extensions › examples › json-editor
Create a JSON editor
Create a parsedContent React Memo that returns the content file value as parsed JSON. If there is an error parsing it, return null instead. The React useMemo hook caches a result based on an array of dependencies between re-renders to improve ...
🌐
GitHub
github.com › constantoduol › JSONEditor
GitHub - constantoduol/JSONEditor: A react visual json editor
import {JSONEditor} from 'react-json-editor-viewer'; constructor(){ this.onJsonChange = this.onJsonChange.bind(this); } onJsonChange(key, value, parent, data){ console.log(key, value, parent, data); } <JSONEditor data={{ the: "men", that: "landed", on: "the", moon: "were", maybe: 2, i: "think", probably: ["neil armstrong", "buzz aldrin"], am_i_right: true }} collapsible onChange={this.onJsonChange} />
Starred by 103 users
Forked by 18 users
Languages   JavaScript 99.5% | HTML 0.5% | JavaScript 99.5% | HTML 0.5%
🌐
npm
npmjs.com › package › react-json-editor-ajrm
react-json-editor-ajrm - npm
Latest version: 2.5.14, last published: 3 years ago. Start using react-json-editor-ajrm in your project by running `npm i react-json-editor-ajrm`. There are 87 other projects in the ...
      » npm install react-json-editor-ajrm
    
Published   Jan 29, 2023
Version   2.5.14
Author   andrew.redican.mejia@gmail.com
🌐
GitHub
github.com › AndrewRedican › react-json-editor-ajrm
GitHub - AndrewRedican/react-json-editor-ajrm: A modular, easy to use, react component, to view, edit, and debug javascript objects.
A modular, easy to use, react component, to view, edit, and debug javascript objects. - AndrewRedican/react-json-editor-ajrm
Starred by 360 users
Forked by 126 users
Languages   JavaScript 98.9% | JavaScript 98.9%
Top answer
1 of 3
1

You can use some JSON editor like react-ace

Put your json file in assets, then import it to your component and follow the guide on the README! Your component would look like:

Copyconst [text, setText] = useState(JSON.stringify(yourJsonFile, null, 2));

function handleChange(text, event) {
  try {
    setText(text && JSON.parse(text));
  } catch (error) {
    // pass, user is editing
  }
}

return (
  <AceEditor
    mode="java"
    theme="github"
    onChange={handleChange}
    name="UNIQUE_ID_OF_DIV"
    editorProps={{ $blockScrolling: true }}
    value={text}
  />
);
2 of 3
0

In a React project, all your source code and assets are in the src folder. The compiler will put everything you need in the public folder. If the JSON file is not copied, you might need a plugin that copies static files to the public folder.

About your other question: do you want the user to be able to edit the JSON as a text string? Then you can just load the JSON and keep it as a string. That string you could put into some text input field. It could look something like this:

Copyfetch('assets/myfile.json')
    .then(responseString => {
        myEditableTextField.value = responseString
    })

To store the results after the user edited it, you will still need some kind of server page (NodeJS or PHP) that can save the file back to a JSON file after editing.

But note this is still bad practice. There is an extremely high chance that the JSON will not be correct after the user has edited it.

It would be better to build some kind of CMS that edits all the JSON properties separately.

Copyfetch('assets/myfile.json')
    .then(responseString => responseString.json())
    .then(data => {
        myEditablenameField.value = data.name
        // etc. for all values in the json file
    })
🌐
npm
npmjs.com › package › react-json-editor
react-json-editor - npm
The full code for the demo can be found at https://github.com/ismaelga/react-json-editor/blob/master/demos/demo.jsx.
      » npm install react-json-editor
    
Published   May 19, 2017
Version   0.3.0
Author   Ismael Abreu
🌐
CodeSandbox
codesandbox.io › s › react-json-editor-osveq
React JSON Editor - CodeSandbox
May 2, 2020 - React JSON Editor by rokki using @contentful/forma-36-react-components, @json-editor/json-editor, brace, jsoneditor, jsoneditor-react, react, react-dom, react-scripts
Published   May 02, 2020
Author   rokki
🌐
GitHub
github.com › arqex › react-json
GitHub - arqex/react-json: A JSON editor packed as a React.js component. The easiest way of create web forms.
var doc = { hola: "amigo", array: [1,2,3] }; React.render( <Json value={ doc } onChange={ logChange } />, document.body ); function logChange( value ){ console.log( value ); } ... Do you hate creating forms?
Starred by 97 users
Forked by 38 users
Languages   JavaScript 93.2% | CSS 6.8% | JavaScript 93.2% | CSS 6.8%