Academind Using React.js without JSX and Webpack is an example.
Many packages are used to handle things like state management.It's hard to learn all of this at once when you're new to React.Let's build a simple app.
Babel means we need something like Webpack, since most people use JSX with React.We don't have to worry about that if we do not use jsx.This example will get us started.
The element type is the first argument we'll see later.The properties you can pass into that element are referred to as props.Child elements are the third."Hello, world!" will be displayed in this case.We could put another component here or even a list of them.
It's possible to write "Hello, world!" instead of "react.createElement" with the help of JSX.If you want to know more about it, you can see React Without JSX.
The applications can be split into components.The beginning of a TODO app shows components.
When creating lists of elements, you must provide a unique string called a key.I don't recommend you read about react keys at the moment.
The class style is needed for creating components to get state and lifecycle hooks.Babel would need to be used again, because most examples use ES6 classes.Pull in create-react-class if you want to avoid this.We can use the createReactClass function to create stateful components.Here's an example.