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

SetCustomTextInput not working on React Native 0.57.3 #17

Open
Rodrigo77777 opened this issue Oct 29, 2018 · 16 comments
Open

SetCustomTextInput not working on React Native 0.57.3 #17

Rodrigo77777 opened this issue Oct 29, 2018 · 16 comments

Comments

@Rodrigo77777
Copy link

Rodrigo77777 commented Oct 29, 2018

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!

@siminn-arnarfs
Copy link

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?

@berpcor
Copy link

berpcor commented Jan 28, 2019

The same issue.
When fix will be?

@pavermakov
Copy link

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

@zhigang1992
Copy link

zhigang1992 commented Apr 5, 2019

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

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

@kenkotch
Copy link

kenkotch commented Apr 5, 2019

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

@zhigang1992
Copy link

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

@jdgalani
Copy link

+1

@vtolochk
Copy link

vtolochk commented Jun 5, 2019

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

@Ajackster
Copy link
Owner

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

@hotaryuzaki
Copy link

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??

@gguidotti
Copy link

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?

@Ajackster
Copy link
Owner

@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?

@gguidotti
Copy link

gguidotti commented Jul 15, 2019

@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

@hotaryuzaki
Copy link

hotaryuzaki commented Jul 18, 2019

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

@LPGill
Copy link

LPGill commented Jan 3, 2020

@Ajackster @gguidotti any fix for this yet?

@gguidotti
Copy link

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

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

No branches or pull requests