JavaScript for WordPress › Forums › Gutenberg Development › Conditional statements before/on save › Reply To: Conditional statements before/on save
April 11, 2018 at 4:14 pm
#44946
Keymaster
Yup! Checkout that link on JSX conditionals for how to code without an else statement.
Looks something like this (untested but something like this)
{ !isEmpty && ( <a href={ url }>
{ text }
</a> ) }
Hope that helps!!!