You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When the checked prop is updated from the parent component the toggle switch has to change based on the checked prop passed.
Current Behavior
ToggleSwitch is uncontrollable and not updating based on the checked prop.
Possible Solution
1.Need to remove the state updation on click of the switch this.setState ({ isToggleOn: !this.state.isToggleOn });
2. Need to make sure the passed checked prop is reflecting with the toggle switch.
Steps to Reproduce (for bugs)
Render the ToggleSwitch passing the checked and onChange prop
Try to update the checked state from the parent component.
Notice that changed checked state will not reflect in the toggle switch.
Your Environment
Library: React
Version used: 16.12.0
Browser Name and version: Chrome
Operating System and version: macOS
The text was updated successfully, but these errors were encountered:
Issue Type
Bug Report
Component or Pattern Affected
ToggleSwitch
Expected Behavior
When the checked prop is updated from the parent component the toggle switch has to change based on the checked prop passed.
Current Behavior
ToggleSwitch is uncontrollable and not updating based on the checked prop.
Possible Solution
1.Need to remove the state updation on click of the switch
this.setState ({ isToggleOn: !this.state.isToggleOn });
2. Need to make sure the passed checked prop is reflecting with the toggle switch.
Steps to Reproduce (for bugs)
Your Environment
The text was updated successfully, but these errors were encountered: