Skip to content

v3.0.0

Compare
Choose a tag to compare
@prateek3255 prateek3255 released this 23 Mar 05:49
· 19 commits to main since this release
e7cc58e

This update is a complete rewrite of the react-otp-input component internally and has a few breaking changes. The updates include:

  • The earlier version was written with class components which is not recommended anymore and plain JSX leading to no typesafety. To fix this update is rewritten with React hooks and TypeScript offering complete typesafety and much cleaner code.
  • Got rid of the onInput since onChange supersedes it and is recommended by React instead.
  • Add a new renderInput prop that now requires the user to pass their own input and hence allows them to style it or add custom props to it according to their needs, this also helps get rid of many other props that were being passed to the component and then passed to the input, which is not needed anymore because they can be directly passed to the input. Apart from that this also has a few more breaking changes which can be found in the migration guide.
  • The library is now compiled via rollup instead of webpack, since it is the more preferred bundler for libraries and is more easier to use.
  • The example is also rewritten using the Vite react template, which offers lightning fast hot reloads.