
Security News
npm Adopts OIDC for Trusted Publishing in CI/CD Workflows
npm now supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.
react-native-simple-text-captcha
Advanced tools
Create and validate text captcha in React Native app
Create and validate text captcha in React Native app
npm install react-native-simple-text-captcha
yarn add react-native-simple-text-captcha
import type { CaptchaRef } from 'react-native-simple-text-captcha';
import Captcha from 'react-native-simple-text-captcha';
const captchaRef = useRef < CaptchaRef > null;
const [captcha, setCaptcha] = useState('');
const [validateResult, setValidateResult] = useState('');
const validateCaptcha = () => {
const check = captchaRef.current?.validateCaptcha(captcha);
if (check) {
setValidateResult('Captcha Corrected');
} else {
setValidateResult('Captcha Incorrect');
}
};
<Captcha ref={captchaRef} />
<TextInput
style={styles.input}
value={captcha}
onChangeText={setCaptcha}
cursorColor={'#333'}
placeholder="OTP"
/>
<Text>{validateResult}</Text>
<TouchableOpacity style={styles.button} onPress={validateCaptcha}>
<Text style={styles.buttonText}>Validate</Text>
</TouchableOpacity>
Name | Type | Default |
---|---|---|
captchaLength | number | 6 |
background | string | white |
textColor | string | black |
refreshIcon | ReactNode | ↺ |
captchaWrapperStyle | ViewStyle | none |
See the contributing guide to learn how to contribute to the repository and the development workflow.
MIT
Made with create-react-native-library
FAQs
Create and validate text captcha in React Native app
The npm package react-native-simple-text-captcha receives a total of 5 weekly downloads. As such, react-native-simple-text-captcha popularity was classified as not popular.
We found that react-native-simple-text-captcha demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 0 open source maintainers 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
npm now supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.
Research
/Security News
A RubyGems malware campaign used 60 malicious packages posing as automation tools to steal credentials from social media and marketing tool users.
Security News
The CNA Scorecard ranks CVE issuers by data completeness, revealing major gaps in patch info and software identifiers across thousands of vulnerabilities.