TimboKZ / Chonky

😸 A File Browser component for React.
https://chonky.io
MIT License
746 stars 163 forks source link

Icons size is zero after page transitions in next.js #185

Open romikforest opened 1 year ago

romikforest commented 1 year ago

Hi. I'm trying to use chonky in next.js and have a strange problem. Sorry I haven't done a simplified example.

It works perfectly after the page full refresh. But if I have a page transition to another next.js route or come from another route without full refresh all chonky icons disappear. That is they exists, but their size is zero. I explored the page DOM. The span.MuiButton-label still has size 14x30 but some inline classes for svg like svg-inline--fa fa-level-up-alt fa-w-10 fa-fw don't have definitions any more after page transitions. I played a lot with my app but couldn't so anything with this behaviour. Are there some ideas why it can be so?

Chonky 2.3.2

romikforest commented 1 year ago

As a possible solution:

Add to css: @import '@fortawesome/fontawesome-svg-core/styles.css'

Add to _app.ts:

import { config as faConfig } from '@fortawesome/fontawesome-svg-core';
faConfig.autoAddCss = false;