JavaScript for WordPress › Forums › Gutenberg Development › Display div If toggleControl attribute set to true conditional › Reply To: Display div If toggleControl attribute set to true conditional
August 3, 2018 at 2:02 pm
#53878
Zac Gordon
Keymaster
Okay so if you want to control what is displayed on the frontend that is controlled in the save setting since that is what is saved in the database and displayed on the frontend.
You can either use classnames to control display via CSS or use a conditional to not even load the component if toggle is enabled.
Here is some help with JSX conditionals if you need 🙂
https://reactjs.org/docs/conditional-rendering.html
Hopefully that should solve the problem! Let me know if not 🙂