
Security News
Feross on Risky Business Weekly Podcast: npm’s Ongoing Supply Chain Attacks
Socket CEO Feross Aboukhadijeh joins Risky Business Weekly to unpack recent npm phishing attacks, their limited impact, and the risks if attackers get smarter.
react-native-imask
Advanced tools
react-native-imask
Read this before using
I can't say that this plugin is production ready, use it on your own risk. React Native Textinput behavior differs from html input, varies by platform and contains several bugs (1, 2), so some things are not possible to implement. Any PRs are welcomed.
npm install react-native-imask
import {IMaskTextInput} from 'react-native-imask';
<IMaskTextInput
mask={Number}
radix="."
value="123"
unmask={true} // true|false|'typed'
onAccept={
// depending on prop above first argument is
// `value` if `unmask=false`,
// `unmaskedValue` if `unmask=true`,
// `typedValue` if `unmask='typed'`
(value, mask) => console.log(value) // probably should update state
}
// ...and more mask props in a guide
// other TextInput props
editable={true}
style={{
height: 40,
width: '100%',
borderColor: 'gray',
borderWidth: 1
}}
/>
import {IMaskNativeMixin} from 'react-native-imask';
// use `inputRef` to get reference for our custom text input component
const InputComponent = ({inputRef, ...props}) => (
<TextInput
ref={inputRef}
{...props}
/>
);
// wrap component with IMaskNativeMixin
const IMaskTextInput = IMaskNativeMixin(InputComponent);
// use MaskedComponent
<IMaskTextInput
mask="0000"
// ...other props
/>
More options see in a guide.
FAQs
React Native Input Mask
The npm package react-native-imask receives a total of 1,072 weekly downloads. As such, react-native-imask popularity was classified as popular.
We found that react-native-imask demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Socket CEO Feross Aboukhadijeh joins Risky Business Weekly to unpack recent npm phishing attacks, their limited impact, and the risks if attackers get smarter.
Product
Socket’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.
Research
/Security News
Ongoing npm supply chain attack spreads to DuckDB: multiple packages compromised with the same wallet-drainer malware.