React js in 20 minutes

React js in 20 minutes

React js is a javascript library for building user interfaces. Reach js has two category –

  • React for web
  • React native

Prerequisite

  • Html
  • Css
  • Javascript

Start to react we need to understand the following things –

React JSX

JSX means JavaScript XML. Using JSX we can write HTML in React by which we can easily write HTML inside react.

Component

It’s a reusable code component. They return HTML code. It can be two type –

  • Function component
  • Class component

But here we will class component

Get Started


<!DOCTYPE html>
<html>
  <script src="https://unpkg.com/react@16/umd/react.production.min.js"></script>
  <script src="https://unpkg.com/react-dom@16/umd/react-dom.production.min.js"></script>
  <script src="https://unpkg.com/babel-standalone@6.15.0/babel.min.js"></script>
  <body>
  
    <div id="app"></div>

    <script type="text/babel">
      class Hello extends React.Component {
        render() {
          return <h1>Hello World!</h1>
        }
      }

      ReactDOM.render(<p>Hallo</p>, document.getElementById('app'));
    </script>

  </body>
</html>

About the Author: admin