File tree 3 files changed +9
-5
lines changed
3 files changed +9
-5
lines changed Original file line number Diff line number Diff line change 1
1
registry = https://registry.npmjs.org/
2
-
3
-
Original file line number Diff line number Diff line change @@ -38,14 +38,16 @@ If you want use with [Ajv](https://github.com/epoberezkin/ajv):
38
38
``` jsx
39
39
import Ajv from ' ajv' ;
40
40
41
+ const ajv = new Ajv ({ allErrors: true , verbose: true });
42
+
41
43
...
42
44
43
45
render () {
44
46
return (
45
47
< Editor
46
48
value= {yourJson}
47
49
onChange= {this .handleChange }
48
- ajv= {Ajv ({ allErrors : true , verbose : true }) }
50
+ ajv= {ajv }
49
51
schema= {yourSchema}
50
52
/ >
51
53
);
@@ -56,6 +58,7 @@ If you want use with [Ace Editor](https://github.com/thlorenz/brace):
56
58
57
59
``` jsx
58
60
import ace from ' brace' ;
61
+ import ' brace/mode/json' ;
59
62
import ' brace/theme/github' ;
60
63
61
64
...
77
80
78
81
``` jsx
79
82
import ' brace' ;
83
+ import ' brace/mode/json' ;
80
84
import ' brace/theme/github' ;
81
85
82
86
...
@@ -113,13 +117,15 @@ const JsonEditor = importedComponent(() => Promise.all([
113
117
import (/* webpackChunkName:'jsoneditor' */ ' jsoneditor-react' ),
114
118
import (/* webpackChunkName:'jsoneditor' */ ' brace' ),
115
119
import (/* webpackChunkName:'jsoneditor' */ ' ajv' ),
120
+ import (/* webpackChunkName:'jsoneditor' */ ' brace/mode/json' ),
116
121
import (/* webpackChunkName:'jsoneditor' */ ' brace/theme/github' )
117
122
]).then (([{ JsonEditor: Editor }, ace , Ajv ]) => {
123
+ const ajv = new Ajv ();
118
124
return function EditorHoc (props ) {
119
125
return (
120
126
< Editor
121
127
ace= {ace}
122
- ajv= {new Ajv () }
128
+ ajv= {ajv }
123
129
theme= " brace/theme/github"
124
130
{... props}
125
131
/ >
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " jsoneditor-react" ,
3
- "version" : " 0.1.4 " ,
3
+ "version" : " 0.1.5 " ,
4
4
"description" : " React implementation of https://github.com/josdejong/jsoneditor" ,
5
5
"main" : " es" ,
6
6
"module" : " es" ,
You can’t perform that action at this time.
0 commit comments