Replies: 1 comment
-
Easy workaround is to set the I tried with useCallback first. But that did nor work export const MyCanvas: any = ({of}) => {
const [showInfo, setShowInfo] = useState(false);
function toggleInfo() {
setShowInfo(!showInfo)
}
return (
<>
<Canvas key={Number(showInfo)} of={of} additionalActions={[
{
title: 'Show Info',
onClick: toggleInfo,
}
]}></Canvas>
<p>ShowInfo: {String(showInfo)}</p>
</>
);
}; |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi all,
Goal: I want to toggle an info on the additionalActions button on the canvas.
Current behaviour: The the state of
showInfo
changes once. Clicking it again does not change it.Should work: It should always change the state on button click
Anyone knows how I can achive this?
Regards,
basti
The MDX
Beta Was this translation helpful? Give feedback.
All reactions