Styled Components Not Initially Working on a Gatsby Project - reactjs

I have an input field that I have styled with Styled Components. As far as I can tell, everything is fine and it should work without any problems.
However, when I load the page, the input field load with the default browser styles. Only if I make a change to the code will the proper styles show up with hot reloading.
I have made a video showing the problem in case that helps: https://www.loom.com/share/3f9c7a8e7b7a4a85a93332761ea65e2f
In case it is relevant, this is a Gatsby site.
Also, in case it helps -- here is a CodeSandbox link to the project: https://codesandbox.io/s/fresh-cms-version-003-z2724?fontsize=14
Any ideas why this is happening and how to fix it?

Related

Why is my React swiper working properly on localhost but not present on production site?

I am using react swiper from 'swiper/react' for multiple components on my website and it works fine for every component it is used for except for one page. I have a top nav bar that is used as a promotional text banner and it swipes using autoplay every 5 seconds. This navbar exists on every page of my website, it works fine on every page except for one. The problem I'm having trouble shooting is because the swiper works fine on localhost, but once pushed to production, the swiper on this page is barely shown. You can see in the image below, that 2 characters in the swiper are present, and you can see in this image that the swiper is working as expected on every other page.
NOTE: On refresh, the full text is present for about a second before it is skewed and hidden.
The wrapper component styles are positioned to sticky, has a set height, a larger z-index than its background, display is flex. The swiper modules include Navigation and autoplay, loop is set to true, slidesPerView = 1.
What could be causing it to work locally but not work when deployed to a server? Any ideas as to why this functionality is present?
If you need more information please don't hesitate to let me know. Thanks for any advice in advance.
This looks like a CSS issue to me. What do you use for styling? Also, what's different between your localhost styles and the production styles? Note the differences and try to figure out what's missing, if you're not willing to share your code. I've seen cases (especially when using Tailwind) of missing styles in production because a certain plugin removes part of the styles that it thinks that are not used. Those cases are solved by whitelisting certain classes, but I can't tell for sure because I don't know your tech stack.

problems with navbar display

So everything looks like it is going okay on my vscode but on my app display, it doesnt look it. so i installed react bootstrap and i copied a navbar but the display on the app isnt showing properly. please see attachments.[[enter image description here](https://i.stack.imgur.com/vu72C.png)](https://i.stack.imgur.com/FXFY2.png).
please what do i do to sort this issue out? thank you very much.
I copied a navbar from react bootstrap and i think i made the necessary adjustments. i was expecting a dark navbar bg='dark' variant='dark' but i got nothing.

Tab navigation with React but not React-Native?

I'm into PWA development, and I'd like to use React components to build my UI, but not React-native components (otherwise why write PWAs...).
So I am looking for an equivalent to the top-tab-navigator component found here:
https://reactnavigation.org/docs/material-top-tab-navigator/
but without any React-Native dependency!
Changing pages by swiping would be great, even without a visual effect.
So far, I found React components to put tabs on displays inside pages, but nothing with navigator characteristics (full screen views, event on page change, ...).
Any help will be very appreciated.
Thank you!
So far, I found React components to put tabs on displays inside pages, but nothing with navigator characteristics (full screen views, event on page change, ...).

Next.js weird render for first time render from server

I have an issue with render from the server. On the first load of the page, the layout goes for a toss. However it is corrected on subsequent renders via navigating the pages. Surprisingly the weired layout also appears on a browser refresh. I have tested it with both Chrome and Microsoft Edge but same problem.
The app was created using standard boilerplate 'create-next-app' and then I just added a few of my pages. See screenshots below
one with the weird screen
and other showing correct render
This actually an issue with CSS injection with SSR for material-ui. Check examples here

svg sprite load with webpack and react

Hi I am using svg sprite I created using icons8 website for all my website icons, and the icons are working but it seems that the website loads them more than once per page (if i open the network tab i can see it loaded twice or more). I have been looking for a solution for a while now and I cant seem to find the cause of this.
I work with react so I have a component for Icon which uses the tag with xlinkHref attribute.
did anyone encounter such behavior? if yes what would be the best way to approach a solution?

Resources