Is it possible to return the back-end model for react as a JSON file or simple array for the data source?
For example by a function with Axios and fetch?
So you server is running and then you know what data you give back when the client asked to fetch something right?
Also you missed couple of things like
import axios, import DataGrid, and I don’t know what SetUserData is.
Perhaps you need to store your data in some state and then passed it to DataGrid? I’m sorry I don’t really understand your code.
I think like:
this.state = {
data: null
}
...
.then(response => this.setState({ data: response.data })
// and then you return it to DataGrid
<DataGrid datasource={this.state.data} ... />
If you want to use the data from an API, then you need to save it in React class state.
From there you can use it inside your class or just passed it down to another component down the tree.