© Vasan Subramanian 2017

Vasan Subramanian, Pro MERN Stack, 10.1007/978-1-4842-2653-7_4

4. React State

Vasan Subramanian

(1)Bangalore, Karnataka, India

Until now, you’ve only seen static components. To make components that respond to user input and other events, React uses a data structure called state in the component. The state essentially holds the model, something that can change, as opposed to the immutable properties in the form of props that you saw earlier. It is only the change of state that can change the rendered view.

For this chapter, the goal is to add a button and append a row to the initial list of issues on the click of that button. We’ll add this button below the Issues table. By doing that, you’ll learn about a component’s state, ...

Get Pro MERN Stack: Full Stack Web App Development with Mongo, Express, React, and Node now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.