Icons not loading
I'm using material-table with a React TS project, along with Material-UI. I've never had problems with the icons, and I actually use them around my app. When using the material-table package, the icons included with the table do not load correctly. In the screenshot I include, it can be seen that those icons are not loading, while my own icons, like the refresh and chat, are shown appropriately.
I tried to uninstall the node modules and do a npm install once again. I renewed the dependencies and ran npm audit fix. Still, the problem remains the same. I even tried in different browsers. The weirdest thing is that another person with the same project runs the code and he sees those icons correctly. Have you got any idea of how to solve this problem? Since my partner has no problem at all, I'm thinking that it has to do more with my version or environment, but I have got no clue so far. Any help would be appreciated
This is the code for the Material table
<MaterialTable
title={title}
columns={state.columns}
data={state.data}
actions={[
{
icon: Refresh,
tooltip: "Refresh Table",
position: "toolbar",
onClick: () => {
console.log("reload");
reload();
},
},
(rowDataa) => ({
icon: ChatIcon,
tooltip: "View Prediction",
onClick: (event, rowData) => readRowSelected(rowData),
}),
]}
options={{
actionsColumnIndex: -1,
}}
/>
You need to give the icons to the table using the icons prop.
https://github.com/mbrn/material-table/issues/93#issuecomment-591732083
You need to give the icons to the table using the
iconsprop.
Thanks. That was it. Still, I don't know why it was working in my partners machine haha