K
K
KGZVER2020-04-25 18:34:31
React
KGZVER, 2020-04-25 18:34:31

What is wrong in React code?

I wanted to build a class component without using a constructor and props using modern syntax. I can't figure out the reason for the error. Console complains about "=" sign after "state"

import React, {Component} from 'react';

class Forms extends Component {
    state = {}

  changeForm = () => {}

  render() {
      return (
          <div></div>
      )
  }
}

export default Forms

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question