import React, {Component} from 'react'; import { View, Button } from 'react-native';
import {validate} from 'react-native-captcha'
const instructions = Platform.select({ ios: 'Press Cmd+R to reload,\n' + 'Cmd+D or shake for dev menu', android: 'Double tap R on your keyboard to reload,\n' + 'Shake or press menu button for dev menu', });
type Props = {}; export default class App extends Component<Props> { render() { return ( <View style={styles.container}> <Button title={'点击'} onPress={() => { validate("xxx码", (s) => { /**
* s返回值格式
* {
* result:true/false
* message:'返回提示语'
* validate:返回的验证码
* }
* */
alert(s.validate)
});
}}/>
</View>
);
}}