import * as React from "react" ; import { action } from "@storybook/addon-actions" ; import { FormWidget , TableLayoutWidget , FieldElementWidget } from "../src/main" ; author Dylan Vorster
  export class CustomFormWidget extends React . Component < any , any > { formRef : FormWidget ; render ( ) { return ( < div > < FormWidget className = "pure-form" showReset = { false } showSubmit = { false } formSubmitEvent = { action ( "formSubmitAction" ) } ref = { ref => ( this . formRef = ref ) } > < TableLayoutWidget > < FieldElementWidget name = "Name" / > < FieldElementWidget name = "Surname" / > < /TableLayoutWidget> < /FormWidget> < p > My buttons are decoupled : < /p> < br / > < br /> < div onClick = { ( ) => { this . formRef . fireFormSubmitEvent ( ) ; } } style = { { background : "gray" , padding : 10 } } > Click me to save ! < /div> < /div>); } }