react-native-text-input-mask
in progress
Giovane de Loredo
[UPDATE] To use with dev client:
1 - Install expo-build-properties and add in app.json:
plugins: [['expo-build-properties', { iOS: { useFrameworks: 'static' }}]]
2 - Install patch-package and change in the file node_modules/react-native-text-input-mask/android/build.gradle the prop kotlinVersion from '1.4.31' to '1.6.10'
Giovane de Loredo
You need statically link to work on iOS. I've written a plugin for this (it doesn't follow all best practices, but it works): https://gist.github.com/gloredo/ac86934026ec2b88b85c8044b0e6edaa
Adriano Moreira
Giovane de Loredo: Where do I insert this file?
Evan Bacon
marked this post as
in progress
We are investigating how to use this package with the new Expo custom dev clients system.
Lakshay Akula
Evan Bacon: Thanks Evan. Just FYI I tried this out recently using EAS + custom dev clients and got this error during the eas build.
It's referred to in this Github issue. The solution mentions something about
use_frameworks!
(which I am not familiar with).Installing react-native-text-input-mask (3.1.4)
Installing react-native-viewpager (5.0.12)
[!] The following Swift pods cannot yet be integrated as static libraries:
The Swift pod `react-native-text-input-mask` depends upon `React-RCTText`, which does not define modules. To opt into those targets generating module maps (which is necessary to import them from Swift when building as static libraries), you may set `use_modular_headers!` globally in your Podfile, or specify `:modular_headers => true` for particular dependencies.
[stderr] [!] `<PBXResourcesBuildPhase UUID=`13B07F8E1A680F5B00A75B9A`>` attempted to initialize an object with an unknown UUID. `B8947802556840B28A3BE4E9` for attribute: `files`. This can be the result of a merge and the unknown UUID is being discarded.
Linus Unnebäck
The RIFM (React Input Format & Mask) library has a hook that works with any input at all. This means that it can work with the React Native text field without having any native dependencies!
Igor Kharabet
Linus Unnebäck: Unfortunately it can't. I tried and it didn't work for me in RN project. Looking at the code i found that it's because it uses DOM events heavily. Otherwise, a real gem for ReactJS devs.
Linus Unnebäck
Igor Kharabet: Ah, sorry about the missinformation. This should be something that should be solvable though 🤔
If I get the time I'll look into it...
Igor Kharabet
Linus Unnebäck: yeah, actually I tried to achieve that in my fork -
and it kind of works - though, in my case it was quite slow and unstable.. maybe it's because it was just a minimal and easiest way to just make it work in RN - I'm pretty sure there are more elegant and efficient ways to do that, but I'm not feeling skilled enough for it 😅
Giau. Tran Minh
Up!!!
Gabriel Maia
I use https://github.com/benhurott/react-native-masked-text and it works very well with Expo
SDP190
Gabriel Maia: Since its javascript only implementation it sounds a bit slow
Gabriel Maia
SDP190: I used it and it's not slow, give it a try
SDP190
Gabriel Maia: K, will try.
Cooper Brown
Please support this!!
Leonardo Dino
any updates on this one? Brent Vatne
i tried to implement a new one in JS but understood why there aren't many...
Gabriel Schmitt
That would be super useful!