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:
Cristhian Zanforlin Lousa 2024-03-29 00:10:25 -03:00 committed by GitHub
commit dfb8d56f98
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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;