score:1

Accepted answer
<div class="form-group">
  <CustomListComponent
    url="/api/get-code-list/"
    name="code_list"
    onChange={this.handleCodeListChange}
  />
</div>
<div class="form-group">
  <CustomListComponent
    url="/api/get-location-list/"
    name="location_list"
    onChange={this.handleLocationListChange}
  />
</div>

score:0

class Parent extends Component {
    ...

    componentDidMount() {
        /* make API call */
        myArr = someAPICall(url)

        this.setState({myArr});
    }

    render() {
        return (
            <MyListComponent arr={this.state.myArr} />
        );
    }
}

Related Query

More Query from same tag