This is the fifth part of the video series on React JS.
We discuss creating a component in React JS. We’re building a login form.
The example used in the video is given below
<html>
<head>
<script crossorigin src="https://unpkg.com/react@16/umd/react.production.min.js"></script>
<script crossorigin src="https://unpkg.com/react-dom@16/umd/react-dom.production.min.js"></script>
<script src="https://unpkg.com/babel-standalone@6/babel.min.js"></script>
</head>
<body>
<!--Let's build a login form-->
<div id="root"></div>
<script type="text/jsx">
class LoginForm extends React.Component {
render() {
return (<div>
<input type="text" placeholder="User name" id="username"/>
<br/>
<input type="password" placeholder="Password" id="password"/>
<br/>
<button>Login</button>
</div>);
}
}
ReactDOM.render(<LoginForm/>, document.getElementById("root"));
</script>
</body>
</html>
You can find the video here.
Read and watch the other parts here.
| 1. | Hello ReactJS without JSX |
| 2. | Hello ReactJS with JSX |
| 3. | Let’s play with JSX – Part I |
| 4. | Let’s play with JSX – Part II |