Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
000xuandu opened this issue Jan 4, 2022 · 1 comment
Open
Labels
enhancement New feature or request

Comments

@000xuandu
Copy link

000xuandu commented Jan 4, 2022

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 000xuandu added the enhancement New feature or request label Jan 4, 2022
@lauriharpf
Copy link

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 🙏 .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants