Fix minimize (#1579)
♻️ (GenericNode/index.tsx): refactor showNode state initialization and
update logic to use useState and useEffect hooks for better readability
and maintainability
This commit is contained in:
commit
dfb8d56f98
1 changed files with 4 additions and 2 deletions
|
|
@ -211,10 +211,12 @@ export default function GenericNode({
|
|||
}
|
||||
}, [validationStatus, validationStatus?.params]);
|
||||
|
||||
// const showNode = data.showNode ?? true;
|
||||
|
||||
const [showNode, setShowNode] = useState(data.showNode ?? true);
|
||||
|
||||
useEffect(() => {
|
||||
setShowNode(data.showNode ?? true);
|
||||
}, [data.showNode]);
|
||||
|
||||
const nameEditable = true;
|
||||
|
||||
const emojiRegex = /\p{Emoji}/u;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue