Accessing the state data in the implementation

Make the following changes to the component implementation: