Answers for "Ternary Operator react 3 Conditions"

8

ternary operator in button react

render() {
  const isLoggedIn = this.state.isLoggedIn;
  return (
    <div>
      The user is <b>{isLoggedIn ? 'currently' : 'not'}</b> logged in.    
	</div>
  );
}
Posted by: Guest on July-10-2020
0

Ternary Operator react 3 Conditions

<div style={{'backgroundColor': status === 'approved' ? 'blue' : status === 'pending' ? 'black' : 'red'}}>
</div>
Posted by: Guest on March-31-2022

Code answers related to "Javascript"

Browse Popular Code Answers by Language