React

React — Is a JavaScript library for building user interfaces.

It is maintained by Facebook and a community of individual developers and companies.

Can be used as a base in the development of single-page or mobile applications.

Create React App

npx create-react-app my-app
cd my-app
npm start

Add React to a Website

React Without JSX

//with JSX

class Hello extends React.Component {
  render() {
    return <div>Hello {this.props.toWhat}</div>;
  }
}

ReactDOM.render(
  <Hello toWhat="World" />,
  document.getElementById('root')
);


//without JSX

class Hello extends React.Component {
  render() {
    return React.createElement('div', null, `Hello ${this.props.toWhat}`);
  }
}

ReactDOM.render(
  React.createElement(Hello, {toWhat: 'World'}, null),
  document.getElementById('root')
);

JSX is not a requirement for using React. Using React without JSX is especially convenient when you don’t want to set up compilation in your build environment.

Related concepts

React

React — Structure map

Clickable & Draggable!

React — Related pages: