/
gen_FooBar_reactGen.go
67 lines (51 loc) · 1.79 KB
/
gen_FooBar_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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
// Code generated by myitcv.io/react/cmd/reactGen. DO NOT EDIT.
package main
import "myitcv.io/react"
type FooBarElem struct {
react.Element
}
func buildFooBar(cd react.ComponentDef) react.Component {
return FooBarDef{ComponentDef: cd}
}
func buildFooBarElem(props FooBarProps, children ...react.Element) *FooBarElem {
return &FooBarElem{
Element: react.CreateElement(buildFooBar, props, children...),
}
}
func (f FooBarDef) RendersElement() react.Element {
return f.Render()
}
// SetState is an auto-generated proxy proxy to update the state for the
// FooBar component. SetState does not immediately mutate f.State()
// but creates a pending state transition.
func (f FooBarDef) SetState(state FooBarState) {
f.ComponentDef.SetState(state)
}
// State is an auto-generated proxy to return the current state in use for the
// render of the FooBar component
func (f FooBarDef) State() FooBarState {
return f.ComponentDef.State().(FooBarState)
}
// IsState is an auto-generated definition so that FooBarState implements
// the myitcv.io/react.State interface.
func (f FooBarState) IsState() {}
var _ react.State = FooBarState{}
// GetInitialStateIntf is an auto-generated proxy to GetInitialState
func (f FooBarDef) GetInitialStateIntf() react.State {
return FooBarState{}
}
func (f FooBarState) EqualsIntf(val react.State) bool {
return f == val.(FooBarState)
}
// IsProps is an auto-generated definition so that FooBarProps implements
// the myitcv.io/react.Props interface.
func (f FooBarProps) IsProps() {}
// Props is an auto-generated proxy to the current props of FooBar
func (f FooBarDef) Props() FooBarProps {
uprops := f.ComponentDef.Props()
return uprops.(FooBarProps)
}
func (f FooBarProps) EqualsIntf(val react.Props) bool {
return f == val.(FooBarProps)
}
var _ react.Props = FooBarProps{}