Documentation ¶
Index ¶
- type HelloMessageDef
- func (h HelloMessageDef) GetInitialStateIntf() react.State
- func (r HelloMessageDef) OnChange(e *react.SyntheticEvent)
- func (r HelloMessageDef) OnSubmit(e *react.SyntheticEvent)
- func (h HelloMessageDef) Props() HelloMessageProps
- func (r HelloMessageDef) Render() react.Element
- func (h HelloMessageDef) RendersElement() react.Element
- func (h HelloMessageDef) SetState(state HelloMessageState)
- func (h HelloMessageDef) State() HelloMessageState
- type HelloMessageElem
- type HelloMessageProps
- type HelloMessageState
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HelloMessageDef ¶
type HelloMessageDef struct {
react.ComponentDef
}
Step 1 Declare a type that has (at least) an anonymous embedded react.ComponentDef (it can have other fields); this type must have the suffix 'Def', which corresponds to 'Definition'
func (HelloMessageDef) GetInitialStateIntf ¶
func (h HelloMessageDef) GetInitialStateIntf() react.State
GetInitialStateIntf is an auto-generated proxy to GetInitialState
func (HelloMessageDef) OnChange ¶
func (r HelloMessageDef) OnChange(e *react.SyntheticEvent)
func (HelloMessageDef) OnSubmit ¶
func (r HelloMessageDef) OnSubmit(e *react.SyntheticEvent)
func (HelloMessageDef) Props ¶
func (h HelloMessageDef) Props() HelloMessageProps
Props is an auto-generated proxy to the current props of HelloMessage
func (HelloMessageDef) Render ¶
func (r HelloMessageDef) Render() react.Element
Step 5 Define a Render method on the component's non-pointer type
func (HelloMessageDef) RendersElement ¶
func (h HelloMessageDef) RendersElement() react.Element
func (HelloMessageDef) SetState ¶
func (h HelloMessageDef) SetState(state HelloMessageState)
SetState is an auto-generated proxy proxy to update the state for the HelloMessage component. SetState does not immediately mutate h.State() but creates a pending state transition.
func (HelloMessageDef) State ¶
func (h HelloMessageDef) State() HelloMessageState
State is an auto-generated proxy to return the current state in use for the render of the HelloMessage component
type HelloMessageElem ¶
func HelloMessage ¶
func HelloMessage(p HelloMessageProps) *HelloMessageElem
Step 4 Declare a function to create instances of the component, i.e. an element. If your component requires props to be specified, add this to the function signature. If the props are optional, use a props pointer type.
buildHelloMessageElem is code generated to wrap a call to react.CreateElement.
Convention is that this function is given the name of the component, HelloMessage in this instance. Because this component has props, we also accept these as part of the constructor.
type HelloMessageProps ¶
type HelloMessageProps struct {
Message string
}
Step 2 Optionally declare a props type; the naming convention is *Props
func (HelloMessageProps) EqualsIntf ¶
func (h HelloMessageProps) EqualsIntf(val react.Props) bool
func (HelloMessageProps) IsProps ¶
func (h HelloMessageProps) IsProps()
IsProps is an auto-generated definition so that HelloMessageProps implements the myitcv.io/react.Props interface.
type HelloMessageState ¶
Step 3 Optionally declare a state type; the naming convention is *State
func (HelloMessageState) Equals ¶
func (c HelloMessageState) Equals(v HelloMessageState) bool
func (HelloMessageState) EqualsIntf ¶
func (h HelloMessageState) EqualsIntf(val react.State) bool
func (HelloMessageState) IsState ¶
func (h HelloMessageState) IsState()
IsState is an auto-generated definition so that HelloMessageState implements the myitcv.io/react.State interface.