ReactJS lightweight field validator
yarn add validatorus-react
or npm install validatorus-react
export const App: React.FC = () => {
const input = new VldBuilder()
.with(vlds.VLen, 0, 5)
.withFname('Name')
return (
<div className="App">
<header className="App-header">
<input
type="text"
value={input.value}
onChange={(e) => {
input.change(e.target.value)
console.log(e.target.value)
}}
/>
<p>{input.error}</p>
</header>
</div>
)
}
MIT license. Read more in LICENSE file.