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

[Text] font size is changing #2519

Closed
aprilzero opened this Issue Sep 1, 2015 · 43 comments

Comments

Projects
None yet
@aprilzero

Just upgraded to 11-rc and all <Text> font sizes are now being affected by accessibility settings.

Accessibility is great, but this ended up breaking many of our screens. It seems like it would be better to opt into that behavior. Our app wasn't designed for that extreme variability in font size, and I imagine many others weren't either.

We fixed the issue for now by adding allowFontScaling={false} to every text node, but obviously that is verbose and not optimal. It would be great to either have that be default, or a documented way to set it just once globally.

I believe the relevant commit is at 53fb5b6

@myusuf3

This comment has been minimized.

Show comment
Hide comment
@myusuf3

myusuf3 Sep 1, 2015

Contributor

👍

Contributor

myusuf3 commented Sep 1, 2015

👍

@ide

This comment has been minimized.

Show comment
Hide comment
@ide

ide Sep 1, 2015

Collaborator

FWIW I believe honoring the accessibility settings should be the default for the same reasons why a web browser lets you magnify text if you want to. Looking at my phone's apps, most of the text is for content more than presentation.

Easiest way to do it globally is maybe to override the default props (untested):

import { Text } from 'react-native';

let originalGetDefaultProps = Text.getDefaultProps;
Text.getDefaultProps = function() {
  return {
    ...originalGetDefaultProps(),
    allowFontScaling: false,
  };
};
Collaborator

ide commented Sep 1, 2015

FWIW I believe honoring the accessibility settings should be the default for the same reasons why a web browser lets you magnify text if you want to. Looking at my phone's apps, most of the text is for content more than presentation.

Easiest way to do it globally is maybe to override the default props (untested):

import { Text } from 'react-native';

let originalGetDefaultProps = Text.getDefaultProps;
Text.getDefaultProps = function() {
  return {
    ...originalGetDefaultProps(),
    allowFontScaling: false,
  };
};
@yamill

This comment has been minimized.

Show comment
Hide comment
@yamill

yamill Sep 2, 2015

Contributor

Was wondering the same thing @aprilzero. Thanks for the allowFontScaling it resolved my issues.

Contributor

yamill commented Sep 2, 2015

Was wondering the same thing @aprilzero. Thanks for the allowFontScaling it resolved my issues.

@aprilzero

This comment has been minimized.

Show comment
Hide comment
@aprilzero

aprilzero Sep 2, 2015

I flipped through some of the top native apps on my phone—Facebook, Instagram, Snapchat, Uber, Calendar and Slack are fixed font sizes that do not follow the accessibility setting.

Others apps like Messenger, Twitter, Spotify, Mail scale the text based on the setting. Seems to be ones that are more text based and have a lot of reading.

IMHO it should be up to the app developer to decide which category their app falls into.

I flipped through some of the top native apps on my phone—Facebook, Instagram, Snapchat, Uber, Calendar and Slack are fixed font sizes that do not follow the accessibility setting.

Others apps like Messenger, Twitter, Spotify, Mail scale the text based on the setting. Seems to be ones that are more text based and have a lot of reading.

IMHO it should be up to the app developer to decide which category their app falls into.

@ide

This comment has been minimized.

Show comment
Hide comment
@ide

ide Sep 2, 2015

Collaborator

Yeah that's fair. @a2 do you have thoughts on this?

Collaborator

ide commented Sep 2, 2015

Yeah that's fair. @a2 do you have thoughts on this?

@a2

This comment has been minimized.

Show comment
Hide comment
@a2

a2 Sep 2, 2015

Contributor

It seems that this changed in 53fb5b6. The commit message says that allowFontScaling should be false by default but the code and UIExplorer example say otherwise.

Contributor

a2 commented Sep 2, 2015

It seems that this changed in 53fb5b6. The commit message says that allowFontScaling should be false by default but the code and UIExplorer example say otherwise.

@yamill

This comment has been minimized.

Show comment
Hide comment
@yamill

yamill Sep 2, 2015

Contributor

Ah so I guess this a bug. I can submit a quick PR.

Contributor

yamill commented Sep 2, 2015

Ah so I guess this a bug. I can submit a quick PR.

@yamill

This comment has been minimized.

Show comment
Hide comment
@yamill

yamill Sep 2, 2015

Contributor

I submitted a PR for this - #2530

Contributor

yamill commented Sep 2, 2015

I submitted a PR for this - #2530

@myusuf3

This comment has been minimized.

Show comment
Hide comment
@myusuf3

myusuf3 Sep 3, 2015

Contributor

@yamill 👍

Contributor

myusuf3 commented Sep 3, 2015

@yamill 👍

@vjeux

This comment has been minimized.

Show comment
Hide comment
@vjeux

vjeux Sep 7, 2015

Contributor

IMHO it should be up to the app developer to decide which category their app falls into.

In my experience, if you do not have accessibility features baked by default, then no one will really implement it properly. We've done a lot of work with React Native to get voice over working well by default: any element that is <Touchable*> will be accessible and the hint will be a concatenation of all the text inside (if any). We absolutely should have font scaling be the default, and if it doesn't work well with some screens of your app, then you can disable it.

Also, I just tried and Facebook does update some text to be bigger with accessibility settings:
accessibility

Contributor

vjeux commented Sep 7, 2015

IMHO it should be up to the app developer to decide which category their app falls into.

In my experience, if you do not have accessibility features baked by default, then no one will really implement it properly. We've done a lot of work with React Native to get voice over working well by default: any element that is <Touchable*> will be accessible and the hint will be a concatenation of all the text inside (if any). We absolutely should have font scaling be the default, and if it doesn't work well with some screens of your app, then you can disable it.

Also, I just tried and Facebook does update some text to be bigger with accessibility settings:
accessibility

@ide ide referenced this issue Sep 8, 2015

Closed

Font Scaling Fix #2605

@ccheever

This comment has been minimized.

Show comment
Hide comment
@ccheever

ccheever Sep 13, 2015

Contributor

If this is the intended behavior can this issue be closed? Or is there more to do here? @aprilzero - maybe you could just make a NonScalingText component that wraps Text sets the prop such that the text doesn't scale?

Contributor

ccheever commented Sep 13, 2015

If this is the intended behavior can this issue be closed? Or is there more to do here? @aprilzero - maybe you could just make a NonScalingText component that wraps Text sets the prop such that the text doesn't scale?

@brentvatne

This comment has been minimized.

Show comment
Hide comment
@brentvatne

brentvatne Sep 14, 2015

Collaborator

@ccheever - I think you're right that this can be closed now, this option won't be changed -- defining your own Text component to reduce boilerplate seems like a solution where necessary.

Collaborator

brentvatne commented Sep 14, 2015

@ccheever - I think you're right that this can be closed now, this option won't be changed -- defining your own Text component to reduce boilerplate seems like a solution where necessary.

@brentvatne brentvatne closed this Sep 14, 2015

@GantMan

This comment has been minimized.

Show comment
Hide comment
@GantMan

GantMan Dec 23, 2015

Contributor

I know this issue is closed, but I think we conflated two questions, and left the more important one discarded.

YES it should default to true, and because it's an option, it should be a simple global (not just per instance) for the developer to disable app-wide. @ccheever and @brentvatne please consider that as we utilize 3rd party node modules, we don't always have access to the underlying textviews to restructure them to a nonscaling text.

Contributor

GantMan commented Dec 23, 2015

I know this issue is closed, but I think we conflated two questions, and left the more important one discarded.

YES it should default to true, and because it's an option, it should be a simple global (not just per instance) for the developer to disable app-wide. @ccheever and @brentvatne please consider that as we utilize 3rd party node modules, we don't always have access to the underlying textviews to restructure them to a nonscaling text.

@brentvatne

This comment has been minimized.

Show comment
Hide comment
@brentvatne

brentvatne Dec 23, 2015

Collaborator

Good point @GantMan - can you create an issue on ProductPains for this?

Collaborator

brentvatne commented Dec 23, 2015

Good point @GantMan - can you create an issue on ProductPains for this?

@GantMan

This comment has been minimized.

Show comment
Hide comment
@GantMan

GantMan Dec 23, 2015

Contributor

consider it done!

Contributor

GantMan commented Dec 23, 2015

consider it done!

@12d

This comment has been minimized.

Show comment
Hide comment
@12d

12d Jun 15, 2016

I found a solution,Text.defaultProps.allowFontScaling=false, it works, it is global

12d commented Jun 15, 2016

I found a solution,Text.defaultProps.allowFontScaling=false, it works, it is global

@uc-hus

This comment has been minimized.

Show comment
Hide comment
@uc-hus

uc-hus Sep 18, 2016

12d, Please give me example for Text.defaultProps.allowFontScaling=false

uc-hus commented Sep 18, 2016

12d, Please give me example for Text.defaultProps.allowFontScaling=false

@GantMan

This comment has been minimized.

Show comment
Hide comment
@GantMan

GantMan Sep 18, 2016

Contributor

@uc-hus - you could throw this in your index.ios.js just import text and modify it's defaultProps. Done! All subsequent uses of Text will have font scaling set to false. Super easy 👍

Contributor

GantMan commented Sep 18, 2016

@uc-hus - you could throw this in your index.ios.js just import text and modify it's defaultProps. Done! All subsequent uses of Text will have font scaling set to false. Super easy 👍

@uc-hus

This comment has been minimized.

Show comment
Hide comment
@uc-hus

uc-hus Sep 19, 2016

Gant, Please provide a example!

uc-hus commented Sep 19, 2016

Gant, Please provide a example!

@GantMan

This comment has been minimized.

Show comment
Hide comment
@GantMan

GantMan Sep 25, 2016

Contributor

@uc-hus - I made a PR to Ignite to expose this option in AppSettings.js.
I hope this example helps: infinitered/ignite#389

Contributor

GantMan commented Sep 25, 2016

@uc-hus - I made a PR to Ignite to expose this option in AppSettings.js.
I hope this example helps: infinitered/ignite#389

@uc-hus

This comment has been minimized.

Show comment
Hide comment
@uc-hus

uc-hus Sep 26, 2016

Its not working. Please do something if possible.

Thanks & Regards
Mohammed HUSAIN
Senior Apps Developer, uCertify
+91 9919475253

On Sun, Sep 25, 2016 at 11:36 PM, Gant Laborde notifications@github.com
wrote:

@uc-hus https://github.com/uc-hus - I made a PR to Ignite to expose
this option in AppSettings.js.

I hope this example helps: infinitered/ignite#389
infinitered/ignite#389


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#2519 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/ALoZ1DR6x9W15pT7TTytV0xfnoPPQD0Iks5qtrgngaJpZM4F2Ixk
.

uc-hus commented Sep 26, 2016

Its not working. Please do something if possible.

Thanks & Regards
Mohammed HUSAIN
Senior Apps Developer, uCertify
+91 9919475253

On Sun, Sep 25, 2016 at 11:36 PM, Gant Laborde notifications@github.com
wrote:

@uc-hus https://github.com/uc-hus - I made a PR to Ignite to expose
this option in AppSettings.js.

I hope this example helps: infinitered/ignite#389
infinitered/ignite#389


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#2519 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/ALoZ1DR6x9W15pT7TTytV0xfnoPPQD0Iks5qtrgngaJpZM4F2Ixk
.

@GantMan

This comment has been minimized.

Show comment
Hide comment
@GantMan

GantMan Sep 27, 2016

Contributor

Gonna need more info than that. How about we move this convo off to the reactiflux dischord channel. I am Gantman there, as well
https://discordapp.com/channels/102860784329052160/102861040538120192

Contributor

GantMan commented Sep 27, 2016

Gonna need more info than that. How about we move this convo off to the reactiflux dischord channel. I am Gantman there, as well
https://discordapp.com/channels/102860784329052160/102861040538120192

@ytqiu

This comment has been minimized.

Show comment
Hide comment
@ytqiu

ytqiu Nov 4, 2016

I'm using 0.33.0 with Android, set allowFontScaling=false is not working. At the end, i use ${targetDP} * PixelRatio.get() / PixelRatio.getFontScale() temporarily to hack it.

ytqiu commented Nov 4, 2016

I'm using 0.33.0 with Android, set allowFontScaling=false is not working. At the end, i use ${targetDP} * PixelRatio.get() / PixelRatio.getFontScale() temporarily to hack it.

@SudoPlz

This comment has been minimized.

Show comment
Hide comment
@SudoPlz

SudoPlz Mar 16, 2017

Contributor

I've found out by experience that if you correctly design your app to use points instead of pixel font sizes, you don't need to disable allowFontScaling and you don't need ANY fancy code to choose the right font size for your elements.

I just tell our designer to design for an iPhone 5, and use Points in his mockups, and all magically just works.

Contributor

SudoPlz commented Mar 16, 2017

I've found out by experience that if you correctly design your app to use points instead of pixel font sizes, you don't need to disable allowFontScaling and you don't need ANY fancy code to choose the right font size for your elements.

I just tell our designer to design for an iPhone 5, and use Points in his mockups, and all magically just works.

@devrockzz

This comment has been minimized.

Show comment
Hide comment
@devrockzz

devrockzz Apr 12, 2017

Hi everyone i am going throught this issue " Text.defaultProps.allowFontScaling=false" solved my problem in IOS but it did not solved this issue in android . So is there any why to turn allowFontScaling = false in android ?

Hi everyone i am going throught this issue " Text.defaultProps.allowFontScaling=false" solved my problem in IOS but it did not solved this issue in android . So is there any why to turn allowFontScaling = false in android ?

@dincozdemir

This comment has been minimized.

Show comment
Hide comment
@dincozdemir

dincozdemir May 26, 2017

I've put "Text.defaultProps.allowFontScaling=false" in the constructor of index.android.js and it worked.

import { Text } from 'react-native';
...
constructor() {
  super();
  Text.defaultProps.allowFontScaling=false;
}

I've put "Text.defaultProps.allowFontScaling=false" in the constructor of index.android.js and it worked.

import { Text } from 'react-native';
...
constructor() {
  super();
  Text.defaultProps.allowFontScaling=false;
}
@TimonSotiropoulos

This comment has been minimized.

Show comment
Hide comment
@TimonSotiropoulos

TimonSotiropoulos Jun 26, 2017

I know this is a closed issue, but I am still having an issue with font scaling even after following the above tricks to disable fontScaling on Text Components.

It seems the above trick doesn't stop the Text from scaling when a user sets their Display Zoom settings to "Zoomed" instead of "Standard". Has anyone found a solution to this issue?

The Display Zoom settings can be found on iPhone 6 and up under Settings > Display & Brightness > Display Zoom.

Thanks in Advance!

I know this is a closed issue, but I am still having an issue with font scaling even after following the above tricks to disable fontScaling on Text Components.

It seems the above trick doesn't stop the Text from scaling when a user sets their Display Zoom settings to "Zoomed" instead of "Standard". Has anyone found a solution to this issue?

The Display Zoom settings can be found on iPhone 6 and up under Settings > Display & Brightness > Display Zoom.

Thanks in Advance!

@vmacavero

This comment has been minimized.

Show comment
Hide comment
@vmacavero

vmacavero Aug 6, 2017

Hi all, hi @TimonSotiropoulos , did you manage to find a workaround ? I have the same problem.

Victor

Hi all, hi @TimonSotiropoulos , did you manage to find a workaround ? I have the same problem.

Victor

@TimonSotiropoulos

This comment has been minimized.

Show comment
Hide comment
@TimonSotiropoulos

TimonSotiropoulos Aug 7, 2017

@vmacavero No I haven't found a solution. Just had to redesign some of my screens so they worked in both standard and zoomed modes.

@vmacavero No I haven't found a solution. Just had to redesign some of my screens so they worked in both standard and zoomed modes.

@administerspice

This comment has been minimized.

Show comment
Hide comment
@administerspice

administerspice Aug 29, 2017

These two solutions work globally for iOS but not for Android. Any solutions for setting allowFontScaling=false globally on Android?
Solution 1: Set in root constructor
constructor() { super(); Text.defaultProps.allowFontScaling = false; }
Solution 2: Set in index file
let originalGetDefaultProps = Text.defaultProps; Text.defaultProps = function() { return { ...originalGetDefaultProps, allowFontScaling: false, }; };

administerspice commented Aug 29, 2017

These two solutions work globally for iOS but not for Android. Any solutions for setting allowFontScaling=false globally on Android?
Solution 1: Set in root constructor
constructor() { super(); Text.defaultProps.allowFontScaling = false; }
Solution 2: Set in index file
let originalGetDefaultProps = Text.defaultProps; Text.defaultProps = function() { return { ...originalGetDefaultProps, allowFontScaling: false, }; };

@mnsrv

This comment has been minimized.

Show comment
Hide comment
@mnsrv

mnsrv Oct 12, 2017

This works on Android too
Text.defaultProps.allowFontScaling = false

For TextInput I added prop allowFontScaling={false} and it worked too.

e.g. <TextInput allowFontScaling={false} />

mnsrv commented Oct 12, 2017

This works on Android too
Text.defaultProps.allowFontScaling = false

For TextInput I added prop allowFontScaling={false} and it worked too.

e.g. <TextInput allowFontScaling={false} />

@idws

This comment has been minimized.

Show comment
Hide comment
@idws

idws Oct 18, 2017

I have a problem for this case.
I've add the Text.defaultProps.allowFontScaling = false in the index.android.js
it's works fine except for the case where there's a <Text></Text> inside a <Text></Text>
like this,
... <Text> <Text>This is a sentence</Text> <Text style={{fontWeight: "bold"}}> with</Text> <Text> one word in bold</Text> </Text> ...
and it's only happen in the android.

is there any solution for this?
Thanks in advance

idws commented Oct 18, 2017

I have a problem for this case.
I've add the Text.defaultProps.allowFontScaling = false in the index.android.js
it's works fine except for the case where there's a <Text></Text> inside a <Text></Text>
like this,
... <Text> <Text>This is a sentence</Text> <Text style={{fontWeight: "bold"}}> with</Text> <Text> one word in bold</Text> </Text> ...
and it's only happen in the android.

is there any solution for this?
Thanks in advance

@yaronlevi

This comment has been minimized.

Show comment
Hide comment
@yaronlevi

yaronlevi Mar 1, 2018

+1 for nested <Text><Text>this text is not affected by setting allowFontScaling to false</Text></Text>

yaronlevi commented Mar 1, 2018

+1 for nested <Text><Text>this text is not affected by setting allowFontScaling to false</Text></Text>

@weijiederrick91

This comment has been minimized.

Show comment
Hide comment
@weijiederrick91

weijiederrick91 May 31, 2018

hi any one face any issue with android screen zoom and how to disable the screen zoom ?

hi any one face any issue with android screen zoom and how to disable the screen zoom ?

@MarcelBlockchain

This comment has been minimized.

Show comment
Hide comment
@MarcelBlockchain

MarcelBlockchain Jun 27, 2018

Text.defaultProps.allowFontScaling = false in constructor in App.js (using Expo)
works great for me! Except for placeholder in TextInput, probably because it's a nested Text in Text. Well, minor problem^^

Text.defaultProps.allowFontScaling = false in constructor in App.js (using Expo)
works great for me! Except for placeholder in TextInput, probably because it's a nested Text in Text. Well, minor problem^^

@a-koka

This comment has been minimized.

Show comment
Hide comment
@a-koka

a-koka Jul 12, 2018

This no longer works on react-native 0.56.0. Text.defaultProps is undefined.

a-koka commented Jul 12, 2018

This no longer works on react-native 0.56.0. Text.defaultProps is undefined.

@DevPravin

This comment has been minimized.

Show comment
Hide comment
@DevPravin

DevPravin Jul 12, 2018

Does dynamic type is supported by latest React-Native version?

Reading through the post understand that, it doesn't want to support the dynamic type then set allowFontScaling = false since default value of allowFontScaling is true. But still dynamic type (font scaling) is not working when allowFontScaling=true set.

DevPravin commented Jul 12, 2018

Does dynamic type is supported by latest React-Native version?

Reading through the post understand that, it doesn't want to support the dynamic type then set allowFontScaling = false since default value of allowFontScaling is true. But still dynamic type (font scaling) is not working when allowFontScaling=true set.

@oded-gong-io

This comment has been minimized.

Show comment
Hide comment
@oded-gong-io

oded-gong-io Jul 15, 2018

@a-koka can you please provide a reference to the change in 0.56.0?

@a-koka can you please provide a reference to the change in 0.56.0?

@a-koka

This comment has been minimized.

Show comment
Hide comment
@a-koka

a-koka Jul 15, 2018

I have not had the chance to investigate the source code @oded-gong-io as I'm still fighting with all the breaking changes in my app since the upgrade, nothing major, I still love react-native and the forces behind it :)

All I can say for certain is that I was using Text.defaultProps.allowFontScaling to disable font scaling and this is now breaking. I also verified on a brand new project and Text.defaultProps is indeed coming back as undefined which wasn't the case in 0.55.4.

a-koka commented Jul 15, 2018

I have not had the chance to investigate the source code @oded-gong-io as I'm still fighting with all the breaking changes in my app since the upgrade, nothing major, I still love react-native and the forces behind it :)

All I can say for certain is that I was using Text.defaultProps.allowFontScaling to disable font scaling and this is now breaking. I also verified on a brand new project and Text.defaultProps is indeed coming back as undefined which wasn't the case in 0.55.4.

@patrickkempff

This comment has been minimized.

Show comment
Hide comment
@patrickkempff

patrickkempff Jul 15, 2018

Collaborator

@a-koka I think this is because the Text component is wrapped to inject the forwardedRef prop, see

const Text = (
props: TextProps,
forwardedRef: ?React.Ref<'RCTText' | 'RCTVirtualText'>,
) => {
return <TouchableText {...props} forwardedRef={forwardedRef} />;
};

I am not entirely sure if overwriting the default props of build-in components is currently supported. But to fix your issue you can wrap RN's text component with your own, by doing something alone the lines of:

// custom Text.js
import React, { Component } from 'react';
import { Text as BaseText } from 'react-native';

export default class Text extends Component {
   render () {
      return <BaseText allowFontScaling={false} {...this.props} />
   }
}

// or if you prefer a functional component:

const Text = ({ allowFontScaling = false, ...props }) => {
   return <BaseText allowFontScaling={allowFontScaling} {...props} />
}

export default Text;

Please beware of typo's as i am typing this on mobile

Collaborator

patrickkempff commented Jul 15, 2018

@a-koka I think this is because the Text component is wrapped to inject the forwardedRef prop, see

const Text = (
props: TextProps,
forwardedRef: ?React.Ref<'RCTText' | 'RCTVirtualText'>,
) => {
return <TouchableText {...props} forwardedRef={forwardedRef} />;
};

I am not entirely sure if overwriting the default props of build-in components is currently supported. But to fix your issue you can wrap RN's text component with your own, by doing something alone the lines of:

// custom Text.js
import React, { Component } from 'react';
import { Text as BaseText } from 'react-native';

export default class Text extends Component {
   render () {
      return <BaseText allowFontScaling={false} {...this.props} />
   }
}

// or if you prefer a functional component:

const Text = ({ allowFontScaling = false, ...props }) => {
   return <BaseText allowFontScaling={allowFontScaling} {...props} />
}

export default Text;

Please beware of typo's as i am typing this on mobile

@a-koka

This comment has been minimized.

Show comment
Hide comment
@a-koka

a-koka Jul 15, 2018

Thanks for pointing me to this @patrickkempff. You're absolutely right on both fronts. I do realize that I can just wrap my customizations in a new component but that does require a lot of changes on my end as I have a really large app. Hoping there is some way to override the defaultProps in the near future. If not, writing a custom component does suffice and isn't a terrible solution.

a-koka commented Jul 15, 2018

Thanks for pointing me to this @patrickkempff. You're absolutely right on both fronts. I do realize that I can just wrap my customizations in a new component but that does require a lot of changes on my end as I have a really large app. Hoping there is some way to override the defaultProps in the near future. If not, writing a custom component does suffice and isn't a terrible solution.

@levibuzolic

This comment has been minimized.

Show comment
Hide comment
@levibuzolic

levibuzolic Jul 19, 2018

If you still want to change this globally you can use:

if (Text.defaultProps == null) Text.defaultProps = {};
Text.defaultProps.allowFontScaling = false;

However ideally you should be allowing font scaling and instead spend the time/effort to fix your layout issues to handle different font scales.

If you still want to change this globally you can use:

if (Text.defaultProps == null) Text.defaultProps = {};
Text.defaultProps.allowFontScaling = false;

However ideally you should be allowing font scaling and instead spend the time/effort to fix your layout issues to handle different font scales.

@a-koka

This comment has been minimized.

Show comment
Hide comment
@a-koka

a-koka Jul 21, 2018

Thanks for the hack @levibuzolic. I agree that I should consider font scaling for all my layouts but with so much to do, such hacks are necessary. Glad this was an easy fix. Appreciate the help!

a-koka commented Jul 21, 2018

Thanks for the hack @levibuzolic. I agree that I should consider font scaling for all my layouts but with so much to do, such hacks are necessary. Glad this was an easy fix. Appreciate the help!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.