react-captcha
react-captcha copied to clipboard
基于React和canvas的验证码包
Bumps [postcss](https://github.com/postcss/postcss) from 7.0.27 to 7.0.39. Release notes Sourced from postcss's releases. 7.0.39 Reduce package size. Backport nanocolors to picocolors migration. 7.0.38 Update Processor#version. 7.0.37 Backport chalk to nanocolors migration....
Bumps [shelljs](https://github.com/shelljs/shelljs) from 0.8.3 to 0.8.5. Release notes Sourced from shelljs's releases. v0.8.5 This was a small security fix for #1058. v0.8.4 Small patch release to fix a circular dependency...
Bumps [tmpl](https://github.com/daaku/nodejs-tmpl) from 1.0.4 to 1.0.5. Commits See full diff in compare view [](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter...
Bumps [path-parse](https://github.com/jbgutierrez/path-parse) from 1.0.6 to 1.0.7. Commits See full diff in compare view [](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter...
当前导入方式会把整个lodash整体引入(未压缩是500多kb) https://github.com/WebEngineerLi/react-captcha/blob/ffc2d126635fc5b66280198f2ad5fd8627bd168c/src/captcha.tsx#L4 最好改写成 `import isFunction from 'lodash/isFunction'`,按需导入。 或者直接使用原生的`if(onChange && typeof onChange === 'function')`进行判断。 另外styled-components我觉得也可以直接用行内样式代替。 https://github.com/WebEngineerLi/react-captcha/blob/ffc2d126635fc5b66280198f2ad5fd8627bd168c/src/style.ts#L1-L5 为了一个样式去引入一个二十多kb的依赖得不偿失。