Created
June 26, 2017 15:09
-
-
Save DovydasNavickas/98c27e87477d7fe904af450baef1a8ab to your computer and use it in GitHub Desktop.
Minimal app using @simplr/react-forms.
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
import React from "react"; | |
import ReactDOM from "react-dom"; | |
import { FormOnSubmitCallback } from "@simplr/react-forms-dom/contracts"; | |
import { Form, Text, Submit } from "@simplr/react-forms-dom"; | |
export class App extends React.Component<{}, {}> { | |
onSubmit: FormOnSubmitCallback = (event, store) => { | |
console.log(store.ToObject()); | |
}; | |
render() { | |
return <Form onSubmit={this.onSubmit}> | |
<Text name="Name" /> | |
<Text name="Surname" /> | |
<Text name="Age" /> | |
<Submit>Submit form</Submit> | |
</Form>; | |
} | |
} | |
ReactDOM.render(<App />, document.getElementById("react-app")); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment