What is the Redux State?
Understand the concept of state in applications through examples.
We'll cover the following...
Fundamentals of state
We’ll build a simple counter app to understand the concept of state.
Let’s create an HTML file named index.html
.
- Insert an
h1
tag to display the counter value. - Insert a
button
to let the user increment the value by one.
Now, let’s create a JavaScript file named index.js
.
- Declare a variable
counter
and initialize it with0
. - Declare a function
add()
to increment thecounter
value by one and display the updated value in theh1