github.com/jgarto/itcv@v0.0.0-20180826224514-4eea09c1aa0d/examples/sites/examplesshowcase/gen_App_reactGen.go (about) 1 // Code generated by reactGen. DO NOT EDIT. 2 3 package main 4 5 import "myitcv.io/react" 6 7 type AppElem struct { 8 react.Element 9 } 10 11 func buildApp(cd react.ComponentDef) react.Component { 12 return AppDef{ComponentDef: cd} 13 } 14 15 func buildAppElem(children ...react.Element) *AppElem { 16 return &AppElem{ 17 Element: react.CreateElement(buildApp, nil, children...), 18 } 19 } 20 21 func (a AppDef) RendersElement() react.Element { 22 return a.Render() 23 } 24 25 // SetState is an auto-generated proxy proxy to update the state for the 26 // App component. SetState does not immediately mutate a.State() 27 // but creates a pending state transition. 28 func (a AppDef) SetState(state AppState) { 29 a.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 App component 34 func (a AppDef) State() AppState { 35 return a.ComponentDef.State().(AppState) 36 } 37 38 // IsState is an auto-generated definition so that AppState implements 39 // the myitcv.io/react.State interface. 40 func (a AppState) IsState() {} 41 42 var _ react.State = AppState{} 43 44 // GetInitialStateIntf is an auto-generated proxy to GetInitialState 45 func (a AppDef) GetInitialStateIntf() react.State { 46 return AppState{} 47 } 48 49 func (a AppState) EqualsIntf(val react.State) bool { 50 return a == val.(AppState) 51 }