react-yunpian-captcha
v1.0.1
Published
A YunPian Captcha component for React
Downloads
9
Maintainers
Readme
react-yunpian-captcha
A YunPian Captcha component for React
Installation
$ npm install --save react-yunpian-captcha
Usage
import YunPianCaptcha from 'react-yunpian-captcha';
export default () => {
const onSuccess = (validInfo, close) => console.log(validInfo) || close();
return (
<YunPianCaptcha
appId="your-appId"
version="v1"
onSuccess={onSuccess}
/>
);
};
Properties
className: PropTypes.string,
onSuccess: PropTypes.func.isRequired,
onFail: PropTypes.func,
onExit: PropTypes.func,
beforeStart: PropTypes.func,
afterStart: PropTypes.func,
expired: PropTypes.number,
jsonpField: PropTypes.string,
rsaPublicKey: PropTypes.string,
hosts: PropTypes.string,
appId: PropTypes.string.isRequired,
version: PropTypes.string.isRequired,
noButton: PropTypes.bool,
mode: PropTypes.string,
winWidth: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
lang: PropTypes.oneOf(['zh-cn', 'en']),
langPack: PropTypes.object,
License
MIT