I found in an open source project a class like this
class ComponentName extends React.Component{
state = {
somestate here
};
render() {
return <RenderedComponent value={somethings}>{some other things}</RenderedComponent>;
}
}
is it correct to define state
in this way? Shouldn't it be defined inside the class's constructor?