react-native-animated-tabbar icon indicating copy to clipboard operation
react-native-animated-tabbar copied to clipboard

[Feature Request] Want props for adding more props for the tab label.

Open 000xuandu opened this issue 4 years ago • 1 comments

Feature Request

Hi @gorhom We need props, allowing us to add more props to the text label.

Why it is needed

I am facing a case where a client increases the font size of devices' accessibility, which affects the font size of the label tab. Now, I want to add some props for Text component such as: maxFontSizeMultiplier and allowFontScaling

Screen Shot 2022-01-04 at 5 40 18 PM

000xuandu avatar Jan 04 '22 10:01 000xuandu

As a workaround, you might be able to customize the label by setting default props for the Text or Animated.Text component (depending on the preset you use) when your app starts (e.g. in index.js).

For the 'bubble' and 'flashy' presets:

import { Text } from 'react-native'

Text.defaultProps = Text.defaultProps || {};
Text.defaultProps.allowFontScaling = false;

For the 'material' preset:

import Animated from 'react-native-reanimated'

Animated.Text.defaultProps = Animated.Text.defaultProps || {}
Animated.Text.defaultProps.allowFontScaling = false

This of course is a very crude workaround since it changes the behaviour of all Text/Animated.Text elements in your app, but until this feature is implemented it's the only way I've found to tweak these. Better workarounds are welcome 🙏 .

lauriharpf avatar Jan 19 '22 13:01 lauriharpf