You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+5-1Lines changed: 5 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -366,8 +366,9 @@ Custom nodes are provided in the `customNodeDefinitions` prop, as an array of ob
366
366
props, // object (optional)
367
367
hideKey, // boolean (optional)
368
368
showInTypesSelector, // boolean (optional)
369
+
name // string (appears in Types selector)
369
370
defaultValue, // JSON value for a new instance of your component
370
-
name//string
371
+
editable//boolean (optional)
371
372
}
372
373
```
373
374
@@ -378,6 +379,8 @@ The component will receive *all* the same props as a standard node component (se
378
379
By default, your component will be presented to the right of the property key it belongs to, like any other value. However, you can hide the key itself by setting `hideKey: true`, and the custom component will take the whole row. (See the "Presented by" box in the "Custom Nodes" data set for an example.)
379
380
380
381
You can allow users to create new instances of your special nodes by selecting them as a "Type" in the types selector when editing/adding values. Set `showInTypesSelector: true` to enable this. However, if this is enabled you need to also provide a `name` (which is what the user will see in the selector) and a `defaultValue` which is the data that is inserted when the user selects this "type". (The `defaultValue` must return `true` if passed through the `condition` function in order for it to be immediately displayed using your custom component.)
382
+
383
+
Lastly, you can specify whether or not the data inside the node can be edited using the standard editor, with the `editable` prop (default: `true`). If your component includes its own editing interface (e.g. a Date Picker), you might want to disable the standard editor.
381
384
382
385
## Undo functionality
383
386
@@ -403,6 +406,7 @@ This component is heavily inspired by [react-json-view](https://github.com/mac-s
403
406
404
407
## Changelog
405
408
409
+
-**1.2.0**: Allow editing of Custom nodes
406
410
-**1.1.0**: Don't manage data state within component
0 commit comments