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

react-select css not working on Gatsby Static Build #11704

Closed
nsisodiya opened this issue Feb 12, 2019 · 6 comments
Closed

react-select css not working on Gatsby Static Build #11704

nsisodiya opened this issue Feb 12, 2019 · 6 comments
Labels
stale? Issue that may be closed soon due to the original author not responding any more. type: question or discussion Issue discussing or asking a question about Gatsby

Comments

@nsisodiya
Copy link

This may be the most probably problem with React Select.
I have created Issue on their github repo too - JedWatson/react-select#3422

Here is the summary of the issue.
When I am using react-select, I am seeing difference in static build vs development ui.

So, If I don't disable the JavaScript, This is what it shows on browser.
image

But If I disable the JavaScript, I am seeing this
image

Please guide us.

@nsisodiya
Copy link
Author

Here is the repo for this bug - https://github.com/nsisodiya/react-select-gatsby-bug

@pieh
Copy link
Contributor

pieh commented Feb 12, 2019

Hmmm this is tough and not very intuitive. react-select seems to use emotion for styling (it's one of css-in-js variants, not regular plain css).

Because of that you would need to add gatsby-plugin-emotion plugin so it can extract critical css for initial render/javascript disabled scenario. Kind of another tricky thing is that react-select uses emotion@9 (latest is emotion@10), so you would also need to install older version of gatsby-plugin-emotion (and its peer dependencies):

npm install gatsby-plugin-emotion@^2 emotion@^9 emotion-server@^9 react-emotion@^9

and then add gatsby-plugin-emotion to your gatsby-config plugin list.

This seems to fix it for me.

@pieh pieh added the type: question or discussion Issue discussing or asking a question about Gatsby label Feb 12, 2019
@nsisodiya
Copy link
Author

@pieh Thanks a help. Just curious,
because Styled-Component is also css in js kind of mechanism, This kind of problem will occur with styled-components too?
it is true.

@lwih
Copy link

lwih commented Feb 17, 2019

Hey @nsisodiya, did it fix your issue? I'm having the same one but no luck, it didn't help.

@gatsbot
Copy link

gatsbot bot commented Mar 10, 2019

Hiya!

This issue has gone quiet. Spooky quiet. 👻

We get a lot of issues, so we currently close issues after 30 days of inactivity. It’s been at least 20 days since the last update here.

If we missed this issue or if you want to keep it open, please reply here. You can also add the label "not stale" to keep this issue open!

Thanks for being a part of the Gatsby community! 💪💜

@gatsbot gatsbot bot added the stale? Issue that may be closed soon due to the original author not responding any more. label Mar 10, 2019
@gatsbot
Copy link

gatsbot bot commented Mar 21, 2019

Hey again!

It’s been 30 days since anything happened on this issue, so our friendly neighborhood robot (that’s me!) is going to close it.

Please keep in mind that I’m only a robot, so if I’ve closed this issue in error, I’m HUMAN_EMOTION_SORRY. Please feel free to reopen this issue or create a new one if you need anything else.

Thanks again for being part of the Gatsby community!

@gatsbot gatsbot bot closed this as completed Mar 21, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale? Issue that may be closed soon due to the original author not responding any more. type: question or discussion Issue discussing or asking a question about Gatsby
Projects
None yet
Development

No branches or pull requests

3 participants