Ctrl_Alt_Defeat
Ctrl_Alt_Defeat

Reputation: 4009

Reactjs hide radio button using Launch Darkley

I am using Launch Darkley for feature flagging in my ReactJS WebApp.

I am trying to hide the Radio Button below with the following code but it is not working as expected - is there something I am missing?

    <RadioGroup className={styles.radioRoleContainer} aria-label="Select role for searching" name="roles" value={role} onChange={handleRoleChange}>
        <FormControlLabel value={customer} control={<Radio id="Customer" color="default" />} label="As a Customer" />
        {!flags.showEmployee && <FormControlLabel value={employee} control={<Radio id="Employee" color="default" />} label="As an Employee" />}
        <FormControlLabel value={admin} control={<Radio id="Admin" color="default" />} label="As an Administrator" />
    </RadioGroup>

I am trying to either show or hide the Employee Radio Button based on the Flag value in Launch Darkley

Upvotes: 0

Views: 41

Answers (0)

Related Questions