Mosh React Tutorial (part 8)

source
Before moving on…let’s update our code to have more functionality

Decrement button

Add the onDecrement callback in our App’s render, and increment it to manipulate our state counters.

App.js

Insert a decrement button, and other UI attributes.

counter.jsx

Add onDecrement props so counter component uses App component’s functionalities.

counters.jsx

Our Counters should look like this:

Movies

First import the services folder with fakeMoviesService.js and fakeGenreService.js files into your project.
Under components, create movies.jsx

We import getMovies function from our fakeMOvieService.js file and use them to fill up our state.
Then we simply use bootstrap’s table html in our render and display the data.

movies.jsx

App.js

Our Movies list should look like this: