passing functions to nested children 1

passing functions to nested children

 this.handleChange('carrier')} />

Here is what the above code is Doing:
1. We’re importing the GetAllCouriers component from the GetAllCouriers.js file.
2. We’re creating a new component called CarrierSelector.
3. We’re creating a new state called carrier.
4. We’re creating a new method called handleChange.
5. We’re passing the handleChange method to the GetAllCouriers component.
6. We’re passing the carrier state to the GetAllCouriers component.
7. We’re rendering the GetAllCouriers component.

Similar Posts