Hi, I tired below code but not work. pls help me
is={'site.journeyType === Journey.sitename ? false : true'} key={'product-code'} nodeId={'product--id'} label={'Product name'} onClick={() => openbookDocument('12342113')} endIcon={
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.

Aravind GovindarajRank #430 · 5.8K reputationPosted Jun 12, 2023, 7:46 AM EDT
Please find the example for the same
import React, { useState } from 'react'; const MyComponent: React.FC = () => { const [hideLabel, setHideLabel] = useState(false); const toggleLabelVisibility = () => { setHideLabel(!hideLabel); }; return ( Toggle Label {!hideLabel && My Label} ); }; export default MyComponent;n the example above, we use the
useStatehook to create ahideLabelstate variable and asetHideLabelfunction to toggle its value. The label is conditionally rendered based on thehideLabelstate. IfhideLabelisfalse, the label will be displayed; otherwise, it will be hidden.Clicking the "Toggle Label" button will call the
toggleLabelVisibilityfunction, which will update thehideLabelstate, thereby toggling the visibility of the label.By managing the visibility state with a boolean value and conditionally rendering the label component based on that value, you can effectively hide or show the label dynamically in your React application.