styled-components / xstyled

A utility-first CSS-in-JS framework built for React. πŸ’…πŸ‘©β€πŸŽ€βš‘οΈ
https://xstyled.dev
MIT License
2.27k stars 106 forks source link

Feat/react native #273

Closed diegotsi closed 2 years ago

diegotsi commented 3 years ago

Summary

Hi! as everyone should know this lib does not work with react-native since version 1.12.0, we can see more details about this on #123 and #13 .

I already started a package for react-native on version 1x , but now i'm started this one based on v3.

We are using version 1.11.0 on our apps and works pretty well, and after investigating the problem i figured out that the main problem is because createGlobalStyle does not work on react native. We can check more info about this here.

So I created a new package called styled-components-native.

Version 3x has a lot of great features for react web, but maybe not all of them works with react-native, so the main goal of this PR is to start with the basic things that already help us a lot in react native, like Theme, Utility Props, System and the Magic Styled Components.

Why create a new package? It's basically to separate responsibilities and does not limit the web package because of react-native, with a new package we can also use styled-components/native instead of styled-components.

Things that I've done:

Test plan

That's the code I use for the test with react-native:

import styled from '@xstyled/styled-components';

const WrapView = styled(View)`
  width: 200px;
  height: 200px;
  background-color: red;
`;

Before the changes:

Screen Shot 2021-06-03 at 09 04 22

After the changes:

netlify[bot] commented 3 years ago

Deploy request for xstyled accepted.

Name Link
Latest commit 6cca213f1f09e2afbc0e3cf085f414565455c15c
Latest deploy log https://app.netlify.com/sites/xstyled/deploys/60b8c600a6faf7000884a614
kamalbennani commented 3 years ago

@gregberge Any news regarding future support of React-native?

gregberge commented 3 years ago

@kamalbennani ask @diegotsi, I am not a React Native user, so I can't work on it.

diegotsi commented 3 years ago

Hi @kamalbennani, I'm planning to finish this by the end of next week.

eugeneross commented 3 years ago

@diegotsi Looking forward to seeing this. Is the plan to have this be compatible with both v1 and v2? Or just one?

gregberge commented 2 years ago

Looks like it will never happen, I close it.