@auraxy/react-luosimao
v1.1.1
Published
luosimao
Downloads
10
Readme
@auraxy/react-luosimao
pkg.module supported
, which means that you can apply tree-shaking in you project
luosimao
Installation
npm i -S @auraxy/react-luosimao
Global name - The variable the module exported in umd
bundle
ReactLuoSiMao
Interface
See what method or params you can use in index.d.ts
Usage
import React, { useState } from 'react'
import { ReactLuoSiMao, resetLuoSiMao } from '@auraxy/react-luosimao'
const SignUp = () => {
const [captcha, setCaptcha] = useState('')
const submit = () => {
api().finally(() => {
resetLuoSiMao()
})
}
return (
<div>
...other form items
<ReactLuoSiMao
siteKey="6949f47d7f1f236a091befa93f"
onChange={setCaptcha}
/>
</div>
)
}
style
For building style, you may need to import the css or scss file:
// scss
import 'node_modules/@auraxy/react-luosimao/lib/css/index.scss'
// css
import 'node_modules/@auraxy/react-luosimao/lib/css/index.css'
Or
// scss
@import 'node_modules/@auraxy/react-luosimao/lib/css/index.scss'
// css
@import 'node_modules/@auraxy/react-luosimao/lib/css/index.css'
Or, you can build your custom style by copying, editing and importing node_modules/@auraxy/react-luosimao/lib/css/index.scss
QA
- Error
Error: spawn node-sass ENOENT
You may need install node-sass globally,
npm i -g node-sass