React components Authorization form project

Hi every body. please can any one help me to fix this problem in the task 8 of the project when i try to execute my code nothing its happen and explain me the this.state object and and the line 11 in my code this is my code :

import React from 'react';
import ReactDOM from 'react-dom';

class Contact extends React.Component {
  constructor(props) {
    this.state = {
      password: 'swordfish',
      authorized: false
    this.authorize = this.authorize.bind(this);

  authorize(e) {
    const password =
    const auth = password == this.state.password;
      authorized: auth

  render() {
    const login = (
      <form action="#" onSubmit={authorize}>
    <input type="password" placeholder="Password" />
    <input type="submit" />
    const contactInfo = (
    return (
  <div id="authorization">
        <h1>{this.state.authorized === true ? Contact : "Enter the password"}</h1>
        {this.state.authorized === true ? contactInfo : login} 

  <Contact />, 

Hi @method3884535642
did you take a look at the browser’s console? It says 'Uncaught ReferenceError: authorize is not defined at Contact.render … '.
Search for ‘authorize’ inside the render method and check if it is correctly declared. If it is check if you reference it correctly.

1 Like

thanks a lot my friend you are amazing

You’re welcome…
Don’t forget that the console is also a good friend :wink:

1 Like

yes of corse friend and the inspect also

1 Like

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