docz icon indicating copy to clipboard operation
docz copied to clipboard

Styles don't work with styled-components + react-native

Open felipefialho opened this issue 4 years ago • 1 comments

Question

Description

Hi! First congratz for this awesome project 😁

We have a monorepo using react-native + styled-components (with xstyled) and it was perfectly working in the last major of Docz (1.x).

But after update to Docz 2.x we have been with problems run it, basically just inline styles of react-native works and all styling that using styled-components have been ignored inside Playground.

Environment

  • docz version: `2.3.1
  • OS: OSX 10.15.7
  • Node/npm version: v14.13.1 / 6.14.11

Additional context/Screenshots

image

We (@brunobertolini, @diegotsi) have tried a lot of things to fix it but we have not been able to advance in the resolutions 😅

Someone can help us with this question?

felipefialho avatar Feb 11 '21 17:02 felipefialho

Hi! We finally figured out the main problem with docz and our react native app. And it's very simple.

We are using xstyled, and this lib export styled from styled-components web, so we test two scenarios

1 . Styled our components using import styled from 'styled-components' and it does not work. 2. Styled our components using import styled from 'styled-components/native' and it's work like a charm ❤️

So for everyone, that's stuck with this problem just check if you are using styled from the native package inside styled-components.

diegotsi avatar May 05 '21 19:05 diegotsi