@jsonpath-tools/jsonpath-editor-react
v1.0.0
Published
Advanced JSONPath (RFC 9535) editor for React.
Downloads
68
Readme
@jsonpath-tools/jsonpath-editor-react
Advanced JSONPath (RFC 9535) editor for React.
Quickstart
Installation:
npm install @jsonpath-tools/jsonpath-editor-reactBasic usage:
import { useState } from "react";
import { JSONPathEditor } from "@jsonpath-tools/jsonpath-editor-react";
import { defaultQueryOptions, jsonSchemaToType } from "@jsonpath-tools/jsonpath";
const queryArgumentType = jsonSchemaToType({ schema: queryArgumentSchema });
export default function Example() {
const [value, setValue] = useState(`$..inventory.*`);
return (
<JSONPathEditor
value={value}
onValueChange={setValue}
queryOptions={defaultQueryOptions}
queryArgument={queryArgument}
queryArgumentType={queryArgumentType} />
);
}It should look like this:

