-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for primitive React interfaces #141
Comments
Wow! That's really neat and something I've been wanting to do. I would love to see the code you have going on for this in a PR or if you want to make a library we can add a section in the readme and link it. Cool stuff! |
I was thinking of a PR (though I am experimenting and will make it more stable). Let me know what you think 😄 |
Don't worry if it's not stable or anything. The code itself is not that important until you hit the review button or check the code complete box 😄 If you do a PR early you can get some immediate feedback and encouragement 👍 |
Cool, I will go ahead and work on a PR! |
Seems like the global |
Its going to be tricky because we convert the glamorous api to our api with babel. styled.div(...) becomes styled('div', classes, vars, content) |
It actually should just work now that I'm thinking about it
|
It's working for |
Here is the thing, I verified the tags with the aliases (Text, View, Image and Touchable) in file
with this test('primitives', () => {
const StyledView = styled.View`font-size: 12px;`
const tree = renderer.create(<StyledView>hello world</StyledView>).toJSON()
expect(tree).toMatchSnapshotWithEmotion()
}); Finally, got it working 🎉 !! If you want I can create a PR for this! |
Already implemented ? |
Ahn... I started working on this but ended up with same implementation, similar to |
Due to which, |
@nitin42 where's your work so far on this.. we are also about to take a crack at react-native implementation and I wanna make sure we build from your findings so far |
Hey there, Sorry, I've been busy lately with maintaining my projects, giving job interviews and busy with some other personal work. I'll start sharing my work on |
In order to render the styles on Native (and may be on Sketch), we will need to tweak TypeError: MOBoxObject is not constructor This error occurs when evaluating But I'll be happy to work on adding support for react native. |
Closed via #658 |
I was experimenting with the primitive React interfaces and made a little hack using
emotion
api.With this, we will be able to style and render the components (
Image
,View
,Text
andTouchable
) with emotion across different targets.I've made one demo showing the usage of
View
,Text
andStyleSheet.create()
with emotion -Usage with
Image
componentLet me know what you think @tkh44 😄
emotion
version:5.2.0
react
version:15.6.1
Relevant code.
What you did:
What happened:
Reproduction:
Problem description:
Suggested solution:
The text was updated successfully, but these errors were encountered: