Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

ternary react

render() {
  const isLoggedIn = this.state.isLoggedIn;
  return (
    <div>
      The user is <b>{isLoggedIn ? 'currently' : 'not'}</b> logged in.    
	</div>
  );
}
Source by reactjs.org #
 
PREVIOUS NEXT
Tagged: #ternary #react
ADD COMMENT
Topic
Name
1+1 =