Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

&& in react jsx

render() {
	// if you want to load a component on state of a boolean value, and don't want to specify
    falsy value like in ternanry operator (?).
  const showNotification = this.state.showNotification;
  return (
    <div>
      {showNotification && <ShowNotification /> }   
	</div>
  );
}
 
PREVIOUS NEXT
Tagged: #react #jsx
ADD COMMENT
Topic
Name
9+5 =