DEV Community

Discussion on: Where do you initialize state in React Component?

Collapse
 
dendihandian profile image
Dendi Handian

It's depends on whether your class need constructor or not. If they need constructor then we have to move it inside, unless it won't work.

Collapse
 
pankajpatel profile image
Pankaj Patel

No, you can still write it outside.