Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import React from 'react';
- import ReactDOM from 'react-dom';
- const fiftyFifty = Math.random() < 0.5;
- // New component class starts here:
- class TonightsPlan extends React.Component{
- render(){
- if (fiftyFifty) {
- return <h1>Tonight I'm going out WOOO</h1>; //place return inside each condition
- }
- else {
- return <h1>Tonight I'm going to bed WOOO</h1>;
- }
- }
- }
- ReactDOM.render(<TonightsPlan />, document.getElementById('app'));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement