Ajackster/react-native-global-props

SetCustomTextInput not working on React Native 0.57.3

Opened this issue · 16 comments

Hey @Ajackster ,

First I wanted to thank you for building this, it has allowed me to save a lot of time building an app for my company and it is really easy to use!

I am having one small issue though. I've recently updated to React Native 0.57.3 (I was previously on 0.55.4). I noticed that for some reason the font family on my text inputs has stopped being updated to my choice of font. All my text components are still respecting the font change, but the text inputs are not (they seem to default to the system font).

So I am calling setCustomText and setCustomTextInput in the same way and one seems to run correctly but the other does not. Any chance you can have a look at this?

Here are a couple of images from my app where you can tell the text inputs do not have the same font as the rest of the text.

https://ibb.co/bxZYRV
https://ibb.co/jJhytA

Thanks for your time!

I'm also having this issue, this could maybe be happening since react-native is moving away from proptypes and more towards flow according to the RN 0.57 changelog?

The same issue.
When fix will be?

I have upgraded to the latest version (1.1.5 at the time of writing this comment) and it worked for me.

It doesn't work on 1.1.5 with react-native ^0.59.3.

@pavermakov what's your version of react-native?

Thank you for the library.
I can also confirm at setCustomTextInput does not work w/ RN 0.59.3 with rn-global-props 1.1.5

Just realize that it's not working for styled-components components but it does work for vanilla react native components.

+1

Any updates? 0.57.7 also doesn't work. How is the situation with the latest version of RN?

Tested this with react-native 0.59.9 and it seems to be working. Am I missing something here?

in expo 33.0 is works.
but i have a question.

Tested this with react-native 0.59.9 and it seems to be working. Am I missing something here?

in Expo 33.0 is works.
but i have a question, for custom font we have to use specific font styling like "bold" using "font-bold", fot italic using "font-italic".
How to implement this??

I'm having the same issue running react-native 0.59.10 and react-native-global-props 1.1.5. I'm not using styled components or anything like that, just regular styles created using StyleSheet.create(), also I'm not using Expo. I tried setting custom styling on View and Text and both are working, but looks like something is wrong with TextInput as this component is not receiving my custom styling. Any hints?

@gguidotti I haven't tried on 0.59.10 but it was working for me on 0.59.9. What styles are you trying to apply? Can you give me some code to look at?

@Ajackster thank your for writing me back!
I put the functions to set my custom props in the main entry of my app, App.js. Inside it there is AppContainer, which is the routing configuration imported from a separated file.

Inside my App.js:

import {
  setCustomTextInput,
  setCustomText
} from 'react-native-global-props';

const customTextProps = {
  style: {
    color: 'red'
  }
};
const customTextInputProps = {
  style: {
    color: 'red'
  }
}

setCustomText(customTextProps);
setCustomTextInput(customTextInputProps);

My Login view receives the color property for my Text components, but my TextInputs aren't. The only styling I'm applying to the TextInputs is related to flex, margin and padding, so I'm pretty sure I'm not overriding colors by mistake:
textInputStyle: { flex: 1, margin: 0, padding: 0, paddingHorizontal: 10 }

If you look at the screenshot, you can see my footer text with red color, as expected, but my TextInputs are still in the default color.
Let me know if you'd like to see a bit more code.

Schermata 2019-07-15 alle 12 10 22

in expo 33.0 is works.
but i have a question.

Tested this with react-native 0.59.9 and it seems to be working. Am I missing something here?

in Expo 33.0 is works.
but i have a question, for custom font we have to use specific font styling like "bold" using "font-bold", fot italic using "font-italic".
How to implement this??

oh sorry, for setCustomTextInput not worked, im using expo 33.0. Im using fontFamily

@Ajackster @gguidotti any fix for this yet?

@LPGill I decided to remove this package and create some custom elements to import all over my app instead of relying on the React Native default components, since it was a small project it didn't take much time and I was happier with this approach.