Documentation ¶
Index ¶
- func RenderToString(w io.Writer, n VNodeAccessor, optFns ...RenderOptionFunc)
- func SameComponent(type1 Component, type2 Component) bool
- func UseHook[T Hook](v VNodeAccessor, h T) T
- type BuildContext
- type BuildContextAccessor
- type Component
- type ComponentWrapper
- type ContextProvider
- type EffectHook
- type Element
- type ElementComponent
- type ElementCreator
- type ElementPainter
- type ElementPatcher
- type Fragment
- type Hook
- type HookAsyncCommitter
- type HookCommitter
- type HookDestroyer
- type Hooks
- type MemoHook
- type Portal
- type Provider
- type RefHook
- type RenderOptionFunc
- type StateHook
- func (s *StateHook[T]) CleanTimer()
- func (s *StateHook[T]) Commit()
- func (s *StateHook[T]) CommitAsync()
- func (s *StateHook[T]) Destroy()
- func (s *StateHook[T]) Mount()
- func (s *StateHook[T]) String() string
- func (s *StateHook[T]) Update(v T)
- func (s *StateHook[T]) UpdateFunc(fn func(prev T) T)
- func (s *StateHook[T]) UpdateHook(next Hook)
- func (s *StateHook[T]) Value() T
- type VNode
- type VNodeAccessor
- type VNodeModifier
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RenderToString ¶
func RenderToString(w io.Writer, n VNodeAccessor, optFns ...RenderOptionFunc)
func SameComponent ¶
func UseHook ¶
func UseHook[T Hook](v VNodeAccessor, h T) T
Types ¶
type BuildContext ¶
type BuildContextAccessor ¶
type BuildContextAccessor interface { VNode() VNodeAccessor RawContext() context.Context }
type Component ¶
type Component interface {
Build(BuildContext) VNode
}
type ComponentWrapper ¶
type ContextProvider ¶
type EffectHook ¶
type EffectHook struct { Setup func() func() Deps []any // contains filtered or unexported fields }
func (*EffectHook) Commit ¶
func (h *EffectHook) Commit()
func (*EffectHook) Destroy ¶
func (h *EffectHook) Destroy()
func (*EffectHook) String ¶
func (h *EffectHook) String() string
func (*EffectHook) UpdateHook ¶
func (h *EffectHook) UpdateHook(next Hook)
type Element ¶
type Element interface { node.Node ElementCreator ElementPatcher ElementPainter }
type ElementComponent ¶
type ElementComponent struct{}
func (ElementComponent) Build ¶
func (ElementComponent) Build(ctx BuildContext) VNode
type ElementCreator ¶
type ElementPainter ¶
type ElementPainter interface {
Layout(gtx layout.Context) layout.Dimensions
}
type ElementPatcher ¶
type Fragment ¶
type Fragment struct{}
func (Fragment) Build ¶
func (f Fragment) Build(BuildContext) VNode
type HookAsyncCommitter ¶
type HookAsyncCommitter interface {
CommitAsync()
}
type HookCommitter ¶
type HookCommitter interface {
Commit()
}
type HookDestroyer ¶
type HookDestroyer interface {
Destroy()
}
type Hooks ¶
type Hooks struct {
// contains filtered or unexported fields
}
func (*Hooks) CommitAsync ¶
func (hs *Hooks) CommitAsync()
type MemoHook ¶
func (*MemoHook[T]) UpdateHook ¶
type RenderOptionFunc ¶
type RenderOptionFunc = func(w *printer)
func WithPretty ¶
func WithPretty(pretty bool) RenderOptionFunc
func WithPtr ¶
func WithPtr(ptr bool) RenderOptionFunc
type StateHook ¶
type StateHook[T comparable] struct { State T OnStateChange func() // contains filtered or unexported fields }
func (*StateHook[T]) CleanTimer ¶
func (s *StateHook[T]) CleanTimer()
func (*StateHook[T]) CommitAsync ¶
func (s *StateHook[T]) CommitAsync()
func (*StateHook[T]) UpdateFunc ¶
func (s *StateHook[T]) UpdateFunc(fn func(prev T) T)
func (*StateHook[T]) UpdateHook ¶
type VNodeAccessor ¶
type VNodeAccessor interface { String() string Key() any SetKey(key any) Type() Component Modifiers() modifier.Modifiers ChildVNodes() []VNode PutChildVNodes(childVNodes ...VNode) ReplaceChildVNodeAccessor(old VNodeAccessor, new VNodeAccessor) ChildVNodeAccessors() []VNodeAccessor Parent() VNodeAccessor IsRoot() bool Node() node.Node BindNode(n node.Node) BindParent(va VNodeAccessor) OnMount(fn func(ctx context.Context, va VNodeAccessor)) OnUpdate(fn func(ctx context.Context, va VNodeAccessor, old VNodeAccessor)) WillRender(oldVNode VNodeAccessor) Update(ctx context.Context) DidMount(ctx context.Context) Use(hook Hook) Hook Hooks() Hooks Destroy() error CommitAsync() }
type VNodeModifier ¶
type VNodeModifier interface {
VNodeOnly()
}
Click to show internal directories.
Click to hide internal directories.