JavaScript for WordPress Forums Gutenberg Development Conditional statements before/on save Reply To: Conditional statements before/on save

#44946
Zac Gordon
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!!!