I have an API that gives an error response in this form
In reactJS I am able to pass the parameters by using this.props.errors to my child component, but now I want to map this.props.errors into the child component as below
state = {
slug: '',
name: '',
address_1: '',
address_2: '',
city: '',
state: '',
postal_code: '',
country_code: '',
phone_number: '',
}
meaning, I want the elements of the error parameter to be placed in a child component's state per element. How do I do that?