Skip to content

Commit 6de07f8

Browse files
committed
feat: 0.1.5, fix README
1 parent a13f133 commit 6de07f8

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

.npmrc

-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1 @@
11
registry = https://registry.npmjs.org/
2-
3-

README.md

+8-2
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,16 @@ If you want use with [Ajv](https://github.com/epoberezkin/ajv):
3838
```jsx
3939
import Ajv from 'ajv';
4040

41+
const ajv = new Ajv({ allErrors: true, verbose: true });
42+
4143
...
4244

4345
render() {
4446
return (
4547
<Editor
4648
value={yourJson}
4749
onChange={this.handleChange}
48-
ajv={Ajv({ allErrors: true, verbose: true })}
50+
ajv={ajv}
4951
schema={yourSchema}
5052
/>
5153
);
@@ -56,6 +58,7 @@ If you want use with [Ace Editor](https://github.com/thlorenz/brace):
5658

5759
```jsx
5860
import ace from 'brace';
61+
import 'brace/mode/json';
5962
import 'brace/theme/github';
6063

6164
...
@@ -77,6 +80,7 @@ Or:
7780

7881
```jsx
7982
import 'brace';
83+
import 'brace/mode/json';
8084
import 'brace/theme/github';
8185

8286
...
@@ -113,13 +117,15 @@ const JsonEditor = importedComponent(() => Promise.all([
113117
import(/* webpackChunkName:'jsoneditor' */'jsoneditor-react'),
114118
import(/* webpackChunkName:'jsoneditor' */'brace'),
115119
import(/* webpackChunkName:'jsoneditor' */'ajv'),
120+
import(/* webpackChunkName:'jsoneditor' */'brace/mode/json'),
116121
import(/* webpackChunkName:'jsoneditor' */'brace/theme/github')
117122
]).then(([{ JsonEditor: Editor }, ace, Ajv ]) => {
123+
const ajv = new Ajv();
118124
return function EditorHoc(props) {
119125
return (
120126
<Editor
121127
ace={ace}
122-
ajv={new Ajv()}
128+
ajv={ajv}
123129
theme="brace/theme/github"
124130
{...props}
125131
/>

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "jsoneditor-react",
3-
"version": "0.1.4",
3+
"version": "0.1.5",
44
"description": "React implementation of https://github.com/josdejong/jsoneditor",
55
"main": "es",
66
"module": "es",

0 commit comments

Comments
 (0)