I am trying to read files of a directory and usin socket i have to render the file name and file data using React.
here is what i have done:
Server :
You can't mutate the state by doing this.state.data.push(msg);
this.state.data.push(msg);
Try
var data = this.state.data; data.push(msg); this.setState({data: data});