akveo / akveo/react-native-ui-kitten

How to pass any variable to StyleService.create?

オープン
#1,633 コメント 0 件 リアクション 0 件 担当者 1 名 @greenfrvr が担当を希望しています GitHub で見る
主要言語
TypeScript
スター
10.7k
フォーク
962
PR マージ指標
30日以内にマージされた PR はありません

説明

Hello,

Is it possible to pass any `variable` to `StyleService.create` so that we can applying conditional styling or pass the prop value to styles?

Please check below code for more clarity.

![image](https://user-images.githubusercontent.com/28209930/179886080-ae2a0cf3-017b-4071-b903-c6f0a7b72270.png)

For my use case, I want to pass the `size` prop to `StyleService.create` and give the fontSize there.

I can achieve this using inline style but I am avoiding inline styles.

I would also love to hear other better approaches to achieve this. Please any help is appreciated.

Thanks.

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。