In this segment, let's continue coding our smart and dumb components inside the Phone Directory application.
The AddSubscriber component takes the input from the user and then updates its own state, storing the details of the subscriber. Then, it passes its state back to the addSubscriberHandler() method inside PhoneDirectory smart component. This method, in turn, adds the subscriber into the subscribersList array, which is maintained by the PhoneDirectory smart component.
In the next video, you’ll see how to make ShowSubscribers a dumb component.
'Smart' you!
Before moving on, commit your code at this stage with the commit message as “Added ‘PhoneDirectory’ as smart component, renamed ‘App’ as ‘ShowSubscribers’ and converted ‘AddSubscribers’ and ‘ShowSubscribers’ as dumb components”. You can view the code diff here.