expo / vector-icons

https://icons.expo.fyi
MIT License
648 stars 114 forks source link

SSR support (Next.js / Expo Web) #193

Open jeroenvisser101 opened 2 years ago

jeroenvisser101 commented 2 years ago

Currently, when used with expo-web (Next.js), during SSR, font loading doesn't happen (obviously), which results in icons not being rendered during SSR. I've narrowed this down to the this logic:

https://github.com/expo/vector-icons/blob/c3e068185fac0b45629188e53cdf81c34f4e7849/src/createIconSet.tsx#L153-L155

Would it be acceptable if I send over a PR that disables this check if Platform.OS === "web"?

jeroenvisser101 commented 2 years ago

It may require additional work still to make sure the font is part of the web CSS, if this is inside of the scope of this project, I'm also willing to look into adding support for this 👍