Skip to content

Instantly share code, notes, and snippets.

@DovydasNavickas
Created June 26, 2017 15:09
Show Gist options
  • Save DovydasNavickas/98c27e87477d7fe904af450baef1a8ab to your computer and use it in GitHub Desktop.
Save DovydasNavickas/98c27e87477d7fe904af450baef1a8ab to your computer and use it in GitHub Desktop.
Minimal app using @simplr/react-forms.
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