Okay, so I finished Redux from the curriculum yesterday. I didn’t go further because I thought I learnt too much and I should practice these new skills before I go any further.
After much difficulty on Codepen I managed to run my React code. (Apparently, the compiler should be changed and external scripts React and ReactDOM should be added)
My question:
We were taught here to create components so,
class componentName extends React.Component {
constructor(props){
super(props);
this.state={
whatever: whatever
};
}
render(){
return someJSX;
}
}
But I was looking at other people’s code on CodePen and they do it in a different way. Why’s that? Which is better? Are they two totally different things?
Other Coders did it so,
var someVar = React.createClass{
statements;
}