I tried to create a react-native-web setup to build a storybook for react-native components that use stacks for layouting.
First and foremost: This library solves layouting screens very very well and avoids a ton of headache (and code), so thank you for this 🙏
Now the problem I am facing surfaces when rendering a component that uses padding/margin from a styled (as in styled-components) stacks component (Box) in my case.
which renders with a clean react-native-web app (no storybook included yet) as
Note that there IS verticalpadding and margin but no horizontal (explicitly defining `marginTop/Bottom/Left/Right did yield the same result).
Inspecting the rendered html reveals that indeed only vertical values are applied:
I tried to create a react-native-web setup to build a storybook for react-native components that use
stacks
for layouting. First and foremost: This library solves layouting screens very very well and avoids a ton of headache (and code), so thank you for this 🙏Now the problem I am facing surfaces when rendering a component that uses
padding
/margin
from astyled
(as instyled-components
)stacks
component (Box
) in my case.This is the component in question
which renders with a clean react-native-web app (no storybook included yet) as Note that there IS vertical
padding
andmargin
but no horizontal (explicitly defining `marginTop/Bottom/Left/Right did yield the same result).Inspecting the rendered html reveals that indeed only vertical values are applied:
Here's my webpack config (built after https://mobily.github.io/stacks/docs/react-native-web#webpack)
I am using
stacks@1.4.1
.Edit: I tried to put together a code sandbox illustrating the problem https://codesandbox.io/s/react-native-web-stacks-reproducer-dth8h
Thanks in advance 🙏