- React Forms
Handling forms is about how you handle the data when it changes value or gets submitted. In HTML, form data is usually handled by the DOM. In React, form data is usually handled by the components. When the data is handled by the components, all the data is stored in the component state. You can…
- React Events
Just like HTML, React can perform actions based on user events. React has the same events as HTML: click, change, mouseover etc. A good practice is to put the event handler as a method in the component class: class Profile extends React.Component { changeName() { alert(“name changed!”); } render()…
- React Lifecycle
Each component in React has a lifecycle which you can monitor and manipulate during its three main phases. The three phases are: Mounting, Updating, and Unmounting. Mounting Mounting means putting elements into the DOM. React has four built-in methods that gets called, in this order, when mounting…
- React State
React components has a built-in state object. The state object is where you store property values that belongs to the component. When the state object changes, the component re-renders. State is similar to props, but it is private and fully controlled by the component. class Profile extends…
- React Props
Props are like function arguments, and you send them into the component as attributes. Props are passed to components via HTML attributes. React Props are like function arguments in JavaScript and attributes in HTML Passing props is how information flows in React apps, from parents to children. To…