Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

if or react

// Before your return / render block you could write something like this:
const ifThisOrThat = ifThis || ifThat;

// then you can use it in your return / render block like so:
{ ifThisOrThat &&
	<p>I will render ifThis or ifThat is true!</p>
}
Source by reactjs.org #
 
PREVIOUS NEXT
Tagged: #react
ADD COMMENT
Topic
Name
4+2 =