Closed enaluz closed 4 years ago
I made a very simple patch for myself to use this feature now-- it involved adding maxFontSizeMultiplier={this.props.maxFontSizeMultiplier || 2}
to the 4 <Text/>
components, and adding maxFontSizeMultiplier?: number
to the types file. 2 might not be the optimal default value, but was good enough for my use case. Happy to make a PR if we agree on this implementation.
Thanks for noting this and sharing your solution. A PR would be welcome.
I would recommend adding a prop object that passes through to the Text
components. While you need it for allowFontScaling
presently, someone down the road may want to insert another prop. That seems to be the most flexible approach.
Currently there are optionTextPassThruProps
and selectTextPassThruProps
for some of the Text elements. You could add new props to the others in the same fashion.
I pushed PR with the changes that you've discussed... You can find it here, could you please take a look
Thanks @tetianastepova for the PR.
This feature has been published in 2.0.3
I recently had to go into my app and add better styling support for devices with varying font scaling. Typically this is done with props applied to the
<Text/>
component likemaxFontSizeMultiplier
andallowFontScaling
. Although I could supply custom components to the<ModalSelector/>
component, it would be great if I could just pass down the necessary props directly to the<Text/>
component.Is there already a way to do this that I'm missing? Would appreciate everyone's thoughts on this.