fix: template defects

This commit is contained in:
h z
2025-04-18 02:16:17 +01:00
parent 137ea649f8
commit c20cb168ff
10 changed files with 55 additions and 27 deletions

View File

@@ -1,13 +1,14 @@
import React, {useState} from 'react';
import React, {useEffect, useState} from 'react';
const LayoutEditor = ({layout, onChange}) => {
const [_layout, setLayout] = useState(layout || "");
useEffect(() => {setLayout(layout)}, [layout]);
return (
<textarea
className="textarea"
value={_layout}
onChange={(e) => {
setLayout(e.target.value);
onChange(layout);
onChange(e.target.value);
}}
/>
);