How to control buttons' state and content? #443
Replies: 5 comments 11 replies
-
@marospekarik, you can use a deps array as the last argument for useControls, the schema recompute whenever the deps change. |
Beta Was this translation helpful? Give feedback.
-
Thanks @dbismut , that's what I was looking for! |
Beta Was this translation helpful? Give feedback.
-
Unfortunately, there is still something wrong with all of this, when the button turns to disabled mode:
|
Beta Was this translation helpful? Give feedback.
-
See here @dbismut : https://codesandbox.io/s/elated-kare-pwmzit?file=/src/App.js |
Beta Was this translation helpful? Give feedback.
-
The order of the button also gets messed up. It moved to the end. |
Beta Was this translation helpful? Give feedback.
-
Hi,
I am using a button helper and struggling to understand a few things. How do I change the label and set the button disabled programmatically?
const leftPanel = useControls( { button: button(() => {{sendMessage('hello')}}, { disabled: false}), }, { store: myStore } )
I see that documentation or examples for this are missing. I've tried to use something like `myStore.set(), or destruct the object, however, it doesn't work for the button helper.
Beta Was this translation helpful? Give feedback.
All reactions