mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-21 15:16:01 +00:00
fixed save generated content in useEditorData
This commit is contained in:
@@ -15,6 +15,8 @@ export default function useStorage(key, storageObject, initialValue) {
|
||||
return initialValue;
|
||||
}
|
||||
});
|
||||
|
||||
// use storedValue to ref, so that setValue with function argument works without changeing setValue itself
|
||||
const storedValueRef = React.useRef(storedValue);
|
||||
storedValueRef.current = storedValue;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user