Fix phpSerialize useCallback dependency
This commit is contained in:
@@ -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) => {
|
||||
|
||||
Reference in New Issue
Block a user