react-yunpian-captcha

1.0.1 • Public • Published

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,

Read More

License

MIT

Package Sidebar

Install

npm i react-yunpian-captcha

Weekly Downloads

2

Version

1.0.1

License

MIT

Unpacked Size

30.7 kB

Total Files

10

Last publish

Collaborators

  • xlsdg