React-fontawesome: Server Side Render Issue

Created on 16 Jan 2018  路  3Comments  路  Source: FortAwesome/react-fontawesome

When rendering on the server side, there is no way to get the style sheet that is loaded by the font awesome component and send it over with the request.

this is causing my icons to "jump" in size as the styles are applied since the server renders them large, then they are rendered again when react kicks in and the new styles are applied.

Could you create a method to extract out the styles so they can be included by the servers HTML response?

Most helpful comment

If you're using Gatsby, you can use this plugin https://www.gatsbyjs.org/packages/gatsby-plugin-fontawesome-css/ by @jzabala

All 3 comments

I'm having the same problem and was able to solve it by setting a width and height in my scss.

If you're using Gatsby, you can use this plugin https://www.gatsbyjs.org/packages/gatsby-plugin-fontawesome-css/ by @jzabala

Was this page helpful?
0 / 5 - 0 ratings

Related issues

johnnunns picture johnnunns  路  4Comments

michelecocuccio picture michelecocuccio  路  4Comments

jonathanazulay picture jonathanazulay  路  5Comments

AidanNichol picture AidanNichol  路  3Comments

henfreire picture henfreire  路  5Comments