hellomessage

package
v0.0.0-...-990aa43 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 30, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

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

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

State is an auto-generated proxy to return the current state in use for the render of the HelloMessage component

type HelloMessageElem

type HelloMessageElem struct {
	react.Element
}

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

type HelloMessageState struct {
	CurrName string
	Names    []string
}

Step 3 Optionally declare a state type; the naming convention is *State

func (HelloMessageState) Equals

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL