A
A
Astero_lol2016-01-10 17:27:43
React
Astero_lol, 2016-01-10 17:27:43

What is the correct way to specify getInitialState in ES6?

I’m just starting to understand react, I decided to use ES6 right away and ran into such a problem, everywhere it says that in ES6 you need to specify the initial state in this way - state = { ... } , but for some reason it gives me a syntax error, please tell me what could it be the case?821b680a2d874e1fa600550835b12884.png

Answer the question

In order to leave comments, you need to log in

1 answer(s)
Z
Zakhar Orlov, 2016-01-10
@Astero_lol

In constructorthis.state = {}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question