diff --git a/src/pages/ObjectEditor.js b/src/pages/ObjectEditor.js index 75f52977..fbb366c4 100644 --- a/src/pages/ObjectEditor.js +++ b/src/pages/ObjectEditor.js @@ -21,7 +21,7 @@ const ObjectEditor = () => { const fileInputRef = useRef(null); // PHP serialize implementation (reused from SerializeTool) - const phpSerialize = (data) => { + const phpSerialize = useCallback((data) => { if (data === null) return 'N;'; if (typeof data === 'boolean') return data ? 'b:1;' : 'b:0;'; if (typeof data === 'number') { @@ -50,7 +50,7 @@ const ObjectEditor = () => { return result; } return 'N;'; - }; + }, []); // PHP unserialize implementation (reused from SerializeTool) const phpUnserialize = (str) => { @@ -272,7 +272,7 @@ const ObjectEditor = () => { } catch (err) { console.error('Error generating outputs:', err); } - }, []); + }, [phpSerialize]); // Handle file import const handleFileImport = (event) => {