I am using a material table in my react application, this is the npm package I am using, https://www.npmjs.com/package/material-table
In my development, I face no issues but when In production I am facing an error from the material table package. And this error is shown only once and when I refresh it, this error doesn't show again.
Please tell me a solution for this .
react-dom.production.min.js:209 TypeError: r.props.data is not a function
at n.<anonymous> (material-table.js:288)
at fa (react-dom.production.min.js:131)
at as (react-dom.production.min.js:212)
at pl (react-dom.production.min.js:255)
at t.unstable_runWithPriority (scheduler.production.min.js:19)
at qo (react-dom.production.min.js:122)
at fl (react-dom.production.min.js:248)
at Zs (react-dom.production.min.js:239)
at react-dom.production.min.js:123
at t.unstable_runWithPriority (scheduler.production.min.js:19)
This is the component used
const renderRegistrations=()=>{
return (
<MaterialTable
title="Registered Users"
style={{marginLeft:25,marginRight:25,marginBottom:25,marginTop:25}}
columns={columns}
data={users}
editable={{
onRowUpdate: (newData, oldData) =>
new Promise((resolve) => {
setTimeout(() => {
resolve();
dispatch(AdminUpdateUserData(newData))
dispatch(fetchRegisteredUsers());
setTransition(() => TransitionUp);
setOpen({
state:true,
message:"Edited user successfully"
});
}, 600);
}),
}}
options={{
headerStyle: {
backgroundColor: '#121858',
color: '#FFF'
},
searchFieldStyle:{
marginRight:(width==='xs'||width==='sm')?20:((width==='md')?350:500)
}
}}
/>
)
}