something like this
detailPanel={[
{
tooltip: 'xxx',
render: rowData => {
return new Promise((resolve,reject)=>{
fetch(`${MAIN}/v1/xxx?xx=${rowData.xxx}`)
.then(response=>response.json())
.then(res=>{
let {xxx}=res
resolve(<div>{xxx}<div/>)
})
})
},
},
]}
You can return a new component in detail panel render:
detailPanel={[
{
tooltip: 'xxx',
render: rowData => <YourComponent data={rowData}/>
},
]}
Then take your data in componentDidMount function of YourComponent
thanks!
it works
I tried this. The detailPanel does not open up. It just opens and closes automatically. How do we render the data received from remote? The render of the CustomComponent gets called before data is received from remote.
@deepatr12 that's true. This issue shouldn't be closed. I am using hooks to fetch stuff and I am certain it does not work and has exactly the same behaviour you are describing.