grapp-dev / stacks

A set of components for building layouts in React Native. Powered by React Native Unistyles.
https://stacks.grapp.dev
MIT License
982 stars 24 forks source link

Adds defaultWidth to Columns and defaultHeight to Rows #33

Closed domeknn closed 2 years ago

domeknn commented 2 years ago

Due to changes in v2 i wanted to add possibility to remove more boilerplate. <Column /> (width) and <Row /> (height) has default value fluid. To change that u need to add extra node with width="flexProps" or "height="flexProps" so i've added possibility to add default behavior to <Columns /> or <Rows /> component.

Problem:

<Columns>
  <Column width="content">
    <Content />
  </Column>
  <Column width="content">
    <Content />
  </Column>
</Column>

Solution:

<Columns defaultWidth="content">
  <Content />
  <Content />
</Column>
mobily commented 2 years ago

thank you @domeknn ❤️ this feature will be published in the next version (along with some minor fixes and improvements)