Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

problem with social icon loading when deployed to netlify #67

Open
rebeccapeltz opened this issue May 3, 2020 · 2 comments
Open

problem with social icon loading when deployed to netlify #67

rebeccapeltz opened this issue May 3, 2020 · 2 comments

Comments

@rebeccapeltz
Copy link

I really like your starter repo! I ran into a problem that seemed related to using react dangerouslySetInnerHTML. It's especially noticeable when I changed the discord link to a LinkedIn link with a larger icon. It's only noticeable when using gatsby build (don't see this on localhost).
You'll see the icons used in the social section when loading the page.
https://kind-clarke-92e677.netlify.app/

It's in this code in header.js

 {config.header.social ? (
              <ul
                className="socialWrapper visibleMobileView"
                dangerouslySetInnerHTML={{ __html: config.header.social }}
              ></ul>

I replaced the dangerouslySetInnerHTML with static HTML and values from config and I'm still seeing the loading issue. Since it only happens on deployed code, I think it's due to due to SSR.

@rebeccapeltz
Copy link
Author

I solved this by adding the image to the local assets folder and importing the image into the header.js. I'm checking in with Gatsby to see if there are any plugins or language possibilities that would allow me to supply a variable string to an image on a CDN.

@rebeccapeltz
Copy link
Author

Local assets proved not to be a solution. Social images in list items are still rendered before page.

@rebeccapeltz rebeccapeltz reopened this May 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant