This is the following code
//inside constructor
this.state = {
id: props.id,
name: props.name,
dataLoaded: false,
data: require('../data/'+props.id+'.json')
}
Will the data be available when the component was mounted? or it is async or synchronous?
Is it proper way to load data? Or any better solution available?