As above, if hideText is 'True', 'label' text will be disabled and not shown in my button. How to achieve this?
As above, if hideText is 'True', 'label' text will be disabled and not shown in my button. How to achieve this?
Depends on your code but you can generally use ternary operators within jsx.
So where you have your text and want to only show it when the hideText is false you can do a simple condition: { hideText ? (null) : (text) }
so 'hideText ?' evaluates the value of hideText variable/state. Then you have (return value if true) : (return value if false).