Answer the question
In order to leave comments, you need to log in
React why object property returns undefined?
there is such an object, I need to get the value of the "fields" property from it, i.e. an array and use the .map method to render the elements
Here is the implementation
get formData() {
return this.props.deliveryFormData.payload.form;
}
render() {
console.log(Object.entries(this.formData))
return (
<form name="delivery-form" type="post" action="/api/v1/shipping/submit_form" onSubmit={this.handleFormSubmit}>
{
this.formData.fields.map(e => console.log(e.label))
}
</form>
)
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question