material-table icon indicating copy to clipboard operation
material-table copied to clipboard

Icons not loading

Open LeninSG21 opened this issue 6 years ago • 2 comments

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.

bug_material-table

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,
		}}
/>

LeninSG21 avatar Jul 23 '20 16:07 LeninSG21

You need to give the icons to the table using the icons prop.

https://github.com/mbrn/material-table/issues/93#issuecomment-591732083

matthewtridoan avatar Jul 23 '20 19:07 matthewtridoan

You need to give the icons to the table using the icons prop.

#93 (comment)

Thanks. That was it. Still, I don't know why it was working in my partners machine haha

LeninSG21 avatar Jul 23 '20 20:07 LeninSG21