-
-
Save kasprownik/f64aedc8ddaf75ab662e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// demo.js | |
import React from 'react'; | |
import ReactDOM from 'react-dom'; | |
import Form, {Text, SubmitButton} from './src/index'; | |
ReactDOM.render(( | |
<Form onSubmit={data => console.log(data)}> | |
<Text | |
name="name" | |
validate={['required']} | |
placeholder="Type your name here" | |
label="Your name"/> | |
<Text | |
name="email" | |
validate={['required', 'email']} | |
placeholder="Type your email here" | |
label="E-mail"/> | |
<Text | |
name="website" | |
validate={['url']} | |
placeholder="Type your website url here" | |
label="Website"/> | |
<SubmitButton/> | |
</Form> | |
), document.getElementById('container')); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment