Skip to content

cryshado/validatorus-react

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

validatorus-react

npm license TypeScript

ReactJS lightweight field validator

demo

install

yarn add validatorus-react or npm install validatorus-react

example

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>
    )
}

license

MIT license. Read more in LICENSE file.