Comments (4)
Hey, that is the plan! I'm currently testing this and plan on using it in all of my universal production apps.
I only started working on it last month, so I haven't put together any contribution details yet. I'm happy to do that, though.
As for Next.js / Gastby - there is currently a bit of an issue with server-side rendering of React Native apps and using React Native Web when it comes to responsive design. I can follow-up in a separate comment with details since I'm currently on my phone. I currently have a work-around that makes this library work on Next.js + Expo apps, and I assume the same work-around would work for Gatsby, though I haven't tested it yet.
The current workaround is to wrap your app with the DripsyProvider component, and pass an options prop dictionary where ssr
is set to true. options={{ ssr: true }}
. Under the hood, this renders a different component that uses styled-components
. The reason behind this is elaborated in a few other issues. Basically, it comes down to this: when using server-side rendering, every component's props on the first render on the client side must be the exact same as their props on the server's render. Since we use the screen size to determine which style to apply, and this is done using JS, it's possible that the props on the server and client won't match. This happens because the server doesn't know what the screen size will be on the client.
My current work-around is to use actual CSS media queries, rather than JS-based screen measurements, for server-side rendered apps. This way, the components always have the same props. This is achieved by using styled-components
if ssr: true
.
However, this solution isn't long-term safe. Why? Because styled components requires editing a component's className
prop in order to give it styles (and, more importantly, media queries.) However, the people behind React Native Web just deprecated the className prop, so this solution isn't going to work anymore soon.
Hope the long-winded explanation makes sense, let me know if you need me to clarify.
Important note None of what I just said applies if you're willing to lazy-load components. I figured you'd want to use them for good SEO since they're on Gatsby / Next.js, but if you're willing to lazy load them with code splitting, then you can use this library like normal, without setting ssr: true
. 😇
from dripsy.
I'm going to try to put together a separate website for docs, maybe following the layout of the theme ui docs.
from dripsy.
Thanks for the detailed response that will definitely help me as I try to implement the library on gatsby.
I'm going to start playing around with the library and get familiar with it. I'll see if I can get the gatsby implementation running today. I don't mind starting on some components. I'll try to follow the theme-ui components for now and we can merge those in later if you want.
I think a separate website for the docs with the same style as the theme-ui one would be a move. That would be super helpful.
from dripsy.
Sounds good, lmk how it goes.
Right now, most of the standard React Native components can are exported from this library (View
, Box
, Text
, ScrollView
), as well as some nice HTML-like elements (H1
, H2
, ..., P
).
You can see which ones exist in src/components
.
from dripsy.
Related Issues (20)
- Intellisense not working HOT 4
- ☂️ TypeScript 5 + Intellisense HOT 3
- can use Dripsy with expo-router ? HOT 1
- Styled function Autocomplete don't work HOT 8
- Basic usage of variants broken? HOT 31
- drispy/gradient path doesn't match entrypoint HOT 9
- Nested color path not working linearGradient theme HOT 4
- Fatal error on app launch in 4.1.0 HOT 9
- Missing property shadowOffset HOT 7
- `4.3.4` is not released
- Wrong type for `variant` on `TextInput` HOT 3
- Incompatibility with `[email protected]` HOT 18
- Unable to resolve "stable-hash" from "node_modules\dripsy\build\core\use-sx.js" HOT 5
- [$250 bounty] Types breaking with TS 5.1+ ✅ HOT 16
- example with expo router? HOT 2
- Default Style Replacing Custom `sx` Style Props HOT 7
- Nested texts don't seem to inherit parent styles HOT 6
- how to run with jest HOT 2
- [Typescript] how to type a strict color value ? HOT 2
- autocomplete not working HOT 15
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 dripsy.