Please provide the following:
- SDK Version: 49.0.6
- Platforms(Android/iOS/web/all): iOS
- Add the appropriate “Tag” based on what Expo library you have a question on. None seemed relevant
I’m in the process of creating an Expo Module. What I want to create is a custom TextInput component that does transformations as a type (since that experience is subpar in React Native in general due to its async nature).
I’m able to create the module and associated view, and I can get the functionality that I want out of it by having a sub view that is the real UITextField (similar to the Expo WebView tutorial), but the problem I’m having is now tied to styling. While I can style the containing component with a
style tag, I can’t seem to style the input itself, the hardest thing being setting the font of the input.
I also tried making the actual view that the Expo Module uses inherit from UITextField, and that didn’t do anything. I also tried inheriting from
RCTSinglelineTextInputView, and I couldn’t even get that to compile.
Does anyone have an example of making a custom TextInput as an Expo Module? Or any ideas on how I can pass through styles (particularly fonts) to my sub view? A custom TextInput seems like something that should be common enough to want to do, but I can’t find any examples anywhere.