Emotion: React Native

Created on 10 Jul 2017  路  22Comments  路  Source: emotion-js/emotion

Is React Native version planned?

feature request

Most helpful comment

Please put the word out that we want this.

All 22 comments

Not currently.

Looks like emotion is a real contender for unseating styled-components and a native effort might be the nail in the coffin. Just sayin'

@loganpowell glamorous has native support, I'm really pleased with our results from that lib.

@lukewlms yes, but the preference is for the template string ('just css') paradygm on our end...

Maybe now !!!! As styled-component and glamor provide it out of the box now. But we love emotion.

+1

Why is this closed btw? Isn't there any interest in this, even by a community effort?

Please put the word out that we want this.

yes, that will be great! looking forward to have this

Yes! I'm loving emotion and right now it seems like I'll have to use styled-components for React Native with a similar syntax. Erase that reason to switch guys!!!11

If anyone has any inkling on how this might be implemented, I could take a look.

I guess I could look at Styled Components...

Update: I have looked:

This is the PR from Styled Components that got it working on Native Initially: https://github.com/styled-components/styled-components/pull/53/files

I'll have a play around this week.

This is actually one of the make or break use cases in some decisions around alignment on which solution is ideal. But it'll have to come from community I'm guessing...

oh. I have been using emotion with react. Just stepped into react-native and I was so hoping emotion is supported.

馃憤 +1

@DavideDaniel any update on this?

Seems like #658 is ready to be merged

658 got merged! Maybe this can be closed now? cc @steida

While #658 should work in RN this is a specific use case (primitives). General RN integration could still be developed.

Just tested!

import React, { PureComponent } from 'react'

import styled from '@emotion/primitives'

const Container = styled.View`
  flex: 1;
  justify-content: center;
  align-items: center;
  background-color: #f5fcff;
`

const Title = styled.Text`
  font-size: 20px;
  text-align: center;
  color: hotpink;
`

const Description = styled.Text`
  text-align: center;
  color: #333333;
  margin-bottom: 5px;
`
export default class App extends PureComponent {
  render() {
    return (
      <Container>
        <Title>Welcome to Emotion Primitives</Title>
        <Description>Style and render primitives across targets.</Description>
      </Container>
    )
  }
}

Can someone explain/estimate the amount of community effort that remains to be able to consider emotion-js having enough react native support that it could be considered a viable alternative to styled-components, fela, or glamorous-native? The above post makes it feel so close to the finish line that alternatives have already crossed and I would love to see emotion-js keep the momentum going so that what might be the biggest reason most people can't migrate from styled-components/fela goes away.

Most work was done by @nitin42 , so I think he should answer on that question :)

Awesome work folks! Especially @nitin42, will use this in the native app I'm working on!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

AlexanderProd picture AlexanderProd  路  3Comments

johnbrett picture johnbrett  路  3Comments

eddeee888 picture eddeee888  路  3Comments

acnebs picture acnebs  路  3Comments

rockmandash picture rockmandash  路  3Comments