October 2017
Intermediate to advanced
302 pages
7h 27m
English
As the preceding introduction explains, we have a lot of functionality to create in this chapter. In order to keep it all in one place, without cluttering up our App.js, we will create a separate JavaScript class to manage everything to do with notifications. This is a pattern I really like with React, to extract functionality not attached to any one component. In our src/ folder, next to our components folder, let's create a folder called resources, and within that, a file called NotificationResource.js.
The basic outline of our class looks like this:
export default class NotificationResource {}
We create a JavaScript class and export it.
Read now
Unlock full access