/
gen_App_reactGen.go
51 lines (39 loc) · 1.27 KB
/
gen_App_reactGen.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
// Code generated by myitcv.io/react/cmd/reactGen. DO NOT EDIT.
package main
import "myitcv.io/react"
type AppElem struct {
react.Element
}
func buildApp(cd react.ComponentDef) react.Component {
return AppDef{ComponentDef: cd}
}
func buildAppElem(children ...react.Element) *AppElem {
return &AppElem{
Element: react.CreateElement(buildApp, nil, children...),
}
}
func (a AppDef) RendersElement() react.Element {
return a.Render()
}
// SetState is an auto-generated proxy proxy to update the state for the
// App component. SetState does not immediately mutate a.State()
// but creates a pending state transition.
func (a AppDef) SetState(state AppState) {
a.ComponentDef.SetState(state)
}
// State is an auto-generated proxy to return the current state in use for the
// render of the App component
func (a AppDef) State() AppState {
return a.ComponentDef.State().(AppState)
}
// IsState is an auto-generated definition so that AppState implements
// the myitcv.io/react.State interface.
func (a AppState) IsState() {}
var _ react.State = AppState{}
// GetInitialStateIntf is an auto-generated proxy to GetInitialState
func (a AppDef) GetInitialStateIntf() react.State {
return AppState{}
}
func (a AppState) EqualsIntf(val react.State) bool {
return a == val.(AppState)
}