Comments (14)
I decided to use this in my react code
const JSONEditor = require("@json-editor/json-editor").JSONEditor;
with my entire component looking like this (although it's rough and i'm likely to refactor it as i actually start to develop, but coding practices are not the point of this thread π)
import React, {useEffect} from 'react';
import schema from "./schema.json"
import "@fortawesome/fontawesome-free/css/all.css"
const JSONEditor = require("@json-editor/json-editor").JSONEditor;
const BuildView = () => {
useEffect(() => {
const element = document.getElementById('editor_holder');
const editor = new JSONEditor(element, {
schema: schema,
display_required_only: true, // circular references will blow up without this
theme: 'bootstrap4',
iconlib: 'fontawesome5'
});
}, []);
return <div id='editor_holder'></div>
};
export default BuildView;
from json-editor.
I don't understand why info like this isn't added to the documentation or wiki?
The same questions pop up again and again because there's no info in the documentation.
Same goes for new features that are not documented. π
from json-editor.
@Dids yes i can, i had a sample project, but i already deleted it. when i have time, i check it again and add it to the documentation.
from json-editor.
Mozilla is also sponsoring a popular project: https://github.com/mozilla-services/react-jsonschema-form
from json-editor.
The link you posted returns 404...but yea it would be great to have an 'official' react component as part of this lib, id be willing to help contribute.
from json-editor.
@loganvolkers Is the Mozilla lib a full replacement for json-editor?
@narciero What would be needed to make this a react-component?
from json-editor.
import '@json-editor/json-editor'
resolves to object instead of function. I guess there is missing something like an AMD loader in there. Any news on this thread?
from json-editor.
Use import JSONEditor from '@json-editor/json-editor'
works with Vue.js and Angular 2.
from json-editor.
This does ironically work in react development but not in production build. I use node node_modules/react-scripts/bin/react-scripts.js build
to build react app for production deplyoment.
from json-editor.
@crisu83 Can you shed some light on this? (since you're working a lot with react)
from json-editor.
@schmunk42 looking at the code it seems that this editor uses jQuery and DOM manipulation, and usually React doesnβt play very nice with DOM manipulation, so Iβm not sure.
from json-editor.
@crisu83 Thank you for the feedback!
from json-editor.
@marc7000 Can you confirm it's supposed to work with Vue? I can partially see editor elements, but it's throwing the following error: TypeError: (new _json_editor_json_editor__WEBPACK_IMPORTED_MODULE_6___default.a(...)) is not a function
UPDATE: Looks like it's actually initializing without errors, and only erroring when trying to call editor.getValue()
UPDATE 2: Never mind, turned out to be unrelated after all. :)
from json-editor.
@Dids yes i can, i had a sample project, but i already deleted it. when i have time, i check it again and add it to the documentation.
Hi, so where I can find, looks like Wiki page doesn't have article about this
from json-editor.
Related Issues (20)
- Can I Do Dependencies Only On the Default Value And Enum? HOT 1
- [bug]select2 setValue report a error and not select it HOT 8
- Starrating format isn't working properly HOT 1
- bug/regression: bool or number value does not show when remove_empty_properties=true and use_default_values=false
- Can Do a "WACTH" To Another Root "JSON Editor". HOT 4
- Auto generate schema for simple cases HOT 5
- Support for chained / nested watch HOT 2
- Add meta-data (schema builder) example HOT 1
- Validation of datetime-local fails when oneOf is used HOT 3
- An error occurs when a dependency is defined after the field that depends on it HOT 1
- Dependent field does not update when watched field changes HOT 1
- Failure to parse schema with "default": null due to unhandled exception in browser console
- select2 doesn't refer enumSource of item in array. HOT 12
- How do I add my syntax highlighting to Ace Editor? HOT 1
- test
- Enum wont be selected on load if it not the first element HOT 2
- Dependencies with false values not fullfilled HOT 1
- Adding a property breaks UI with a couple of exceptions in the console
- Cannot set (programmatically) value for "enum" string HOT 2
- compare fields HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from json-editor.