react js docs code example

Example 1: install react js

npx create-react-app <appname>  //  eg:  npx create-react-app blog
cd <appname>  // cd blog
npm start  //runs on localhost:3000

Example 2: react js installation

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

Example 3: what is react

This is a formatted version of Komadori's answer 
(https://tinyurl.com/Komadori)
React is a JavaScript library for building user interfaces. 
It is maintained by Facebook and a community of 
individual developers and companies. 
React can be used as a base in the development of single-page 
or mobile applications.

Example 4: react js documentation

//With node and npm already installed for basic start

npx create-react-app my-app-name

// if you want to use npm 

npx create-react-app my-app-name --npm

//if you want to use typescript 

npx create-react-app my-app-name --template typescript

yarn start // app will be hosted on localhost:3000

/* start making changes at ./my-app-name/src/App.js
	React documentation: https://reactjs.org/docs/hello-world.html
*/

Example 5: react native docs

# Good documentation:
https://reactnative.dev/docs/getting-started
https://devdocs.io/react_native/

Example 6: react.js

class ShoppingList extends React.Component {
  render() {
    return (
      <div className="shopping-list">
        <h1>Shopping List for {this.props.name}</h1>
        <ul>
          <li>Instagram</li>
          <li>WhatsApp</li>
          <li>Oculus</li>
        </ul>
      </div>
    );
  }
}

// Example usage: <ShoppingList name="Mark" />