React is framework help you develop web application easily and effectively. It support many techniques to reduce life development and improve experiences of users without have knowledge about web structures.
I began to learn React at 4/11/2019 and completed it exactly 24 hours. In this article, I will cover all important concepts in React and how to use it to increase your programming skill and web development insight. Let’s begin.
Firstly, React let our compose complex UIs from small and isolated pieces of code called “Component”. To create new component, we will create new class which extend Component class of React. You can see example in below.
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>
);
}
}Obviously, ShopingList is called a Component. We can use this component to build complex other component instead of put all them in same script. (They are dirty, difficult to understand and modify 😫)
General, component class must have render method and state variable. React use them to render in DOM browers.
Continue…
