Some months ago I began to study react.js, then I abandoned it. Today I have begun to study React again. Reading the official documentation I find that the syntax of how to create a component has changed. In the past I learned to create a component in this way:
reactComponentElement = React.createClass({
render: function(){
return <h1>Title</h1>;
}
})
so, using React.createClass.
Today I see in the docs that the creation of a component can be achieved with a function
function reactComponentElement(){
return <h1>Title</h1>;
}
or with a class
class Clock extends React.Component {
render() {
return (
<div>
<h1>Hello, world!</h1>
</div>
);
}
}
So, can I still use React.createClass?