Fix phpSerialize useCallback dependency
This commit is contained in:
@@ -21,7 +21,7 @@ const ObjectEditor = () => {
|
|||||||
const fileInputRef = useRef(null);
|
const fileInputRef = useRef(null);
|
||||||
|
|
||||||
// PHP serialize implementation (reused from SerializeTool)
|
// PHP serialize implementation (reused from SerializeTool)
|
||||||
const phpSerialize = (data) => {
|
const phpSerialize = useCallback((data) => {
|
||||||
if (data === null) return 'N;';
|
if (data === null) return 'N;';
|
||||||
if (typeof data === 'boolean') return data ? 'b:1;' : 'b:0;';
|
if (typeof data === 'boolean') return data ? 'b:1;' : 'b:0;';
|
||||||
if (typeof data === 'number') {
|
if (typeof data === 'number') {
|
||||||
@@ -50,7 +50,7 @@ const ObjectEditor = () => {
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
return 'N;';
|
return 'N;';
|
||||||
};
|
}, []);
|
||||||
|
|
||||||
// PHP unserialize implementation (reused from SerializeTool)
|
// PHP unserialize implementation (reused from SerializeTool)
|
||||||
const phpUnserialize = (str) => {
|
const phpUnserialize = (str) => {
|
||||||
@@ -272,7 +272,7 @@ const ObjectEditor = () => {
|
|||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.error('Error generating outputs:', err);
|
console.error('Error generating outputs:', err);
|
||||||
}
|
}
|
||||||
}, []);
|
}, [phpSerialize]);
|
||||||
|
|
||||||
// Handle file import
|
// Handle file import
|
||||||
const handleFileImport = (event) => {
|
const handleFileImport = (event) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user