Comments (9)
Hey ya'll! Is there any thought on getting an example together with Vite + Styled Components since this seems to be the direction Remix is going?
from examples.
Would love to know that as well - just starting to explore Remix + Vite, and styled-components
support is paramount for us.
from examples.
I'm still getting these hydration errors:
Any guidance is VERY much appreciated.
from examples.
Unrelated to this issue, but might still be interesting.
I’ve recently created a CSS-in-JS library that builds CSS like Tailwind, and doesn’t require a Babel/esbuild plugin. Specifically for having no issues with Remix.
Read more here: https://github.com/roj1512/classno
Example app: https://github.com/roj1512/classno_remix
from examples.
Until the root-cause of this is hopefully resolved with react 18.3 you can try out remix-island or a similar approach to hydrate only parts of the document. It works reliably on my end with styled-components (can't stream them though)
from examples.
Hi @iDVB @Xiphe - are there any viable paths forward? Running into a hydration issue on Remix as well with a very minimal setup
from examples.
Both the remix and the react team are aware of this issue. React is actively working towards a solution as this is affecting any solution that hydrates react into the complete document
.
On my end, https://github.com/kiliman/remix-hydration-fix and https://github.com/Xiphe/remix-island present good enough workarounds until the problem will eventually be fixed at it's root cause. You can also try to downgrade react to v17.
from examples.
Thanks for raising this issue! I've just merged a PR that updates our Styled Components example to address the issues mentioned here.
If you're still experiencing issues, let us know, or even help us improve the example if there's something we missed.
from examples.
Hi @markdalgleish thanks for taking the time to update the example on this!
Indeed, the change you added to the example should make it so styled components itself don't cause hydration issues.
Unfortunately, from my experience this still isn't really safe to use with react ~18.2
.
The problem is that when anything else produces a hydration error, react will wipe away the <style>
outlet of styled-components in the head effectively causing any styled component to be unstyled. I haven't validated this with v6 but to my knowledge styled-components is not able to recover from this.
To me that's not a state in which I would ship an app to production.
To my knowledge the only fix is remix-island or waiting and hoping for [email protected].
I understand that there's little to nothing we can do about this from within remix itself (Other then maybe officially supporting rendering into a smaller part of the page) and the update you did on the example is certainly helpful. Still I wouldn't consider this issue fixed.
from examples.
Related Issues (20)
- Blog tutorial needs update of routing HOT 4
- Blog Tutorial uses Route File Naming (v2) HOT 1
- Material UI example is broken HOT 1
- _official-realtime-app example is buggy HOT 3
- Using template as specified does not seem to work HOT 4
- Infinite scrolling example seems to be broken in codesandbox
- Emotion example is outdated HOT 2
- Cookie but missing user in db, ends up being a promise and not redirecting to login HOT 2
- [Feature Request] Framework user wants to have an example integration with Cloudscape Design System HOT 1
- _official-realtime-app Concurrent connections HOT 1
- tailwind styles are not processed in v1.19.2 but are in v1.19.1 HOT 1
- chakra-ui example has hydration issues HOT 2
- Stitches example: Greedy regexp pattern potentially breaks markup HOT 1
- MSW example not working HOT 1
- mdx-bundler example
- Example for Vite + Styled Components?? HOT 1
- Vite + Styled Components Example HOT 4
- Create an example of an app with nested routes
- nprogress uses useTransition, should it use useNavigation instead? HOT 2
- Feature: Pocketbase Auth Example with Realtime Data
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from examples.