Skip to content

Commit

Permalink
fix: save schema
Browse files Browse the repository at this point in the history
  • Loading branch information
JulianWielga committed Aug 12, 2024
1 parent acd2252 commit 812f7b0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/components/codeEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export const CodeEditor = forwardRef<HTMLDivElement, CodeEditorProps>(function C

const jarRef = useRef<CodeJar>(null);
const positionRef = useRef<Position>(null);
const [code, setCode] = useState<string>(value);
const [code, setCode] = useState<string>(null);

//init CodeJar
useEffect(() => {
Expand Down
4 changes: 2 additions & 2 deletions src/components/jsonTextField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ function formatJson(value: string): string {
}

const FieldCodeEditor = ({ name, ...props }: CodeEditorProps & { name: string }) => {
const [{ value, onChange }] = useField(name);
return <CodeEditor {...props} value={value} onChange={onChange} />;
const [{ value }, , { setValue }] = useField(name);
return <CodeEditor {...props} value={value} onChange={setValue} />;
};

export function JsonTextField(props: TextFieldProps) {
Expand Down

0 comments on commit 812f7b0

Please sign in to comment.