Skip to main content

Here’s my widget:


function MyWidget() {
const tinput, setInput] = useSyncedState('myInput', '')
usePropertyMenu(

{
itemType: 'action',
tooltip: 'Open Plugin UI',
propertyName: 'open-plugin-ui',
},
],
({ propertyName, propertyValue }) => {
switch (propertyName) {
case 'open-plugin-ui':
return new Promise(() => figma.showUI(__html__));
}
},
);
useEffect(() => {
console.log('re-render:', input)
})
return (
<Input
value={input}
onTextEditEnd={(e) => setInput(e.characters)}
/>
)
}

While plugin UI is open, no matter how I change my input state, the widget won’t re-render.

Be the first to reply!

Reply