diff --git a/packages/compass-crud/src/components/json-editor.tsx b/packages/compass-crud/src/components/json-editor.tsx index 399628ff92e..2dda284dba4 100644 --- a/packages/compass-crud/src/components/json-editor.tsx +++ b/packages/compass-crud/src/components/json-editor.tsx @@ -84,6 +84,7 @@ const JSONEditor: React.FunctionComponent = ({ const setModifiedEJSONStringRef = useRef<(value: string | null) => void>( doc.setModifiedEJSONString.bind(doc) ); + setModifiedEJSONStringRef.current = doc.setModifiedEJSONString.bind(doc); useEffect(() => { const setModifiedEJSONString = setModifiedEJSONStringRef.current;