Rebass: React Native

Created on 18 Aug 2016  路  13Comments  路  Source: rebassjs/rebass

The same approach I suggested for react-intl https://github.com/yahoo/react-intl/issues/600

Most helpful comment

The world needs universal UI with the common dictionary. Your library is the unicorn because it's only presentional and very thoughtful.

All 13 comments

I'm curious what this would entail for rebass specifically. I'd imagine most of that logic could be contained within the Base component.

Can't be, because Base can not require / import both from React and React Native to be usable universally. Conditional require is no-go since dead code removal would not work in Webpack 2. I think we should have two different higher order components for that.

I'm curious what this would entail for rebass specifically.

div can not be rendered in React Native. We need Text. Otherwise, almost everything should be the same, except platform specific stuff of course.

The world needs universal UI with the common dictionary. Your library is the unicorn because it's only presentional and very thoughtful.

Hi @jxnblk , I like your work and wanted to use something like rebass for native, so I built react native component library off a modified core of rebass. @steida, it definitely isn't striving toward universality, but if you're looking for a similar solution maybe check it out. :)

https://github.com/thomaswright/bayst

I'm hoping with the new setup in v1 that exporting a react native version using react-primitives is something I can get to in the near future, but for now I'm considering this library web-centric as I never do any work on native applications

Hi @jxnblk we're interested in having a universal UI library, if this is something that aligns with the goals of this project we could help out with the work required to take it in that direction

I am also interested in this !!!

I'm open to considering this. Still not sure if it's something that should be part of this repo, or a separate one, but would be open to a PR for discussion. I think the first thing I'd try is using styled-components/primitives and a mapping between a component's type and a relevant react-primitive

I found the following article relevant to this topic: https://medium.com/styled-components/announcing-primitives-support-for-truly-universal-component-systems-5772c7d14bc7. Should the issue be reopened to keep the discussion more visibly alive ?

Thanks, @jxnblk that's exactly what we were thinking and @rsaccon we were basing a lot of the ideas in that article.

We gave it a quick go and it still feels like styled-components/primitives are not ready, we had a few issues and found it a bit too limiting. This isn't an immediate need for us so we won't be exploring it further for a least a few months, but we'll come back to this once we start working on our react-native integration to see if things have changed.

Thanks

I am working on https://github.com/Hermanya/rebass-native
It's based on styled-components/primitives, which works out pretty nicely. But I had to get rid of all of input controls, because they are unbearably unusable, but that's kind of the point of react native, to use native input components.
Here is a demo https://snack.expo.io/@hermanya/github.com-hermanya-rebass-native:examples-app

@airato maybe open sourcing zbase could fill in this gap...

Was this page helpful?
0 / 5 - 0 ratings