Step 8 Not Displaying


#1

https://www.codecademy.com/en/courses/react-101/projects/authorization-form?user_id=54172ccb80ff33257f000a2a

when I cut the ul tags out and add the ternary operator in, the entire page disappears


var React = require('react');
var ReactDOM = require('react-dom');

var Contact = React.createClass({
  getInitialState: function () {
    return {
      password: 'swordfish',
      authorized: false
    };
  },

  authorize: function (e) {
    var password = e.target.querySelector(
      'input[type="password"]').value;
    var auth = password == this.state.password;
    this.setState({
      authorized: auth
    });
  },

  render: function () {
    var login = (
    	<form action='#' onSubmit={this.authorize}>
        <input type='password' placeholder='Password' />
        <input type='submit' />
      </form>
    );
    
    var contactInfo = (
    	<ul>
          <li>
            client@example.com
          </li>
          <li>
            555.555.5555
          </li>
        </ul>
    );
    
    return (
      <div id="authorization">
        <h1>
        {this.state.authorized == true ? 'Contact' : 'Enter the Password'}
        </h1>
        {this.state.authorized == true ? {contactInfo} : {login}}
       
        
      </div>
    );
  }
});

ReactDOM.render(
  <Contact />, 
  document.getElementById('app')
);


#2

After you press Run, immediately Refresh the page. Then try Run again. This is a known issue.


#3

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.