Shopify / restyle

A type-enforced system for building UI components in React Native with TypeScript.
https://shopify.github.io/restyle/
MIT License
2.95k stars 133 forks source link

Let Text component support flex prop #178

Closed selbekk closed 1 year ago

selbekk commented 1 year ago

Is there a way we can make the default Text-component support the flex prop?

Today, this doesn't work:

<Text flex="1">My text takes up all the space</Text>

But this does:

<Text style={{ flex: "1" }}>My text takes up all the space</Text>
flexbox commented 1 year ago

Hey @selbekk Thank you for the issue

Have you read this thread? https://github.com/Shopify/restyle/issues/132#issuecomment-1079873056

layout is not included in textRestyleFunctions

For now instead, of using createText you can "manually" create your Text component to include the props you want.