V
V
Valerii_gold2020-02-01 21:08:08
React
Valerii_gold, 2020-02-01 21:08:08

Error when using Constructor: super() is only valid inside?

Guys, need help. I need to enter two numbers and they are summed up, for this I looked, I need to use the constructor, but for some reason it gives me an error, I don’t understand what’s wrong. Next, I want to complicate mathematical operations, for example, the sum of all the digits of the number that I enter, tell me where to read about it.

Here are the screenshots of the errors:
src=" https://habrastorage.org/webt/5e/35/be/5e35be34aad... " alt="image"/>
5e35be6a18efb287820310.jpeg

Thank you in advance

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
abberati, 2020-02-01
@abberati

You put the body of the class component into the shell of a functional component
Be careful with copy-paste and documentation.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question