1π
β
Can you try adding listener to specific value change, this function will invoke on every state changes. instead of below code
useEffect(() => {},[])
Instead of that if you can specify which variable to listen, then multiple function call can be avoidable.
For example use like this
useEffect(() => {},[notCapture]);
In this scenario if there is any change happens to notCaputure variable, then only function got triggered
0π
Please check the below code. It may help you.
const finalData = () => {
return new Promise((resolve, reject) => {
const data = {
labels: ['January', 'February', 'March', 'April', 'May', 'June', 'July'],
datasets: [{
label: 'My First dataset',
data: actionsListData.map(({ EditorId }) => EditorId)
}]
}
resolve(data)
})
}
<ChartControl
type={ChartType.Bar}
datapromise={finalData()}
/>
Please refer below link for details
https://pnp.github.io/sp-dev-fx-controls-react/controls/ChartControl/
Source:stackexchange.com