github.com/jgarto/itcv@v0.0.0-20180826224514-4eea09c1aa0d/examples/sites/globalstate/gen_PersonChooser_reactGen.go (about) 1 // Code generated by reactGen. DO NOT EDIT. 2 3 package main 4 5 import "myitcv.io/react" 6 7 type PersonChooserElem struct { 8 react.Element 9 } 10 11 func buildPersonChooser(cd react.ComponentDef) react.Component { 12 return PersonChooserDef{ComponentDef: cd} 13 } 14 15 func buildPersonChooserElem(props PersonChooserProps, children ...react.Element) *PersonChooserElem { 16 return &PersonChooserElem{ 17 Element: react.CreateElement(buildPersonChooser, props, children...), 18 } 19 } 20 21 func (p PersonChooserDef) RendersElement() react.Element { 22 return p.Render() 23 } 24 25 // SetState is an auto-generated proxy proxy to update the state for the 26 // PersonChooser component. SetState does not immediately mutate p.State() 27 // but creates a pending state transition. 28 func (p PersonChooserDef) SetState(state PersonChooserState) { 29 p.ComponentDef.SetState(state) 30 } 31 32 // State is an auto-generated proxy to return the current state in use for the 33 // render of the PersonChooser component 34 func (p PersonChooserDef) State() PersonChooserState { 35 return p.ComponentDef.State().(PersonChooserState) 36 } 37 38 // IsState is an auto-generated definition so that PersonChooserState implements 39 // the myitcv.io/react.State interface. 40 func (p PersonChooserState) IsState() {} 41 42 var _ react.State = PersonChooserState{} 43 44 // GetInitialStateIntf is an auto-generated proxy to GetInitialState 45 func (p PersonChooserDef) GetInitialStateIntf() react.State { 46 return PersonChooserState{} 47 } 48 49 func (p PersonChooserState) EqualsIntf(val react.State) bool { 50 return p == val.(PersonChooserState) 51 } 52 53 // IsProps is an auto-generated definition so that PersonChooserProps implements 54 // the myitcv.io/react.Props interface. 55 func (p PersonChooserProps) IsProps() {} 56 57 // Props is an auto-generated proxy to the current props of PersonChooser 58 func (p PersonChooserDef) Props() PersonChooserProps { 59 uprops := p.ComponentDef.Props() 60 return uprops.(PersonChooserProps) 61 } 62 63 func (p PersonChooserProps) EqualsIntf(val react.Props) bool { 64 return p == val.(PersonChooserProps) 65 } 66 67 var _ react.Props = PersonChooserProps{}