Module prelude

Source
Expand description

The Next RS Prelude

Modules§

rsx
The main html module which defines components, listeners, and class helpers.

Macros§

classes
html_nested
rsx
use_prepared_state
use_prepared_state_macro
use_transitive_state
use_transitive_state_macro

Structs§

AnimationEvent
The AnimationEvent class.
Callback
Universal callback wrapper.
Classes
A set of classes, cheap to clone.
Context
The Component’s context. This contains component’s Scope and props and is passed to every lifecycle method.
ContextHandle
Owns the connection to a context provider. When dropped, the component will no longer receive updates from the provider.
ContextProvider
The context provider component.
DragEvent
The DragEvent class.
ErrorEvent
The ErrorEvent class.
Event
The Event class.
FocusEvent
The FocusEvent class.
HookContext
A hook context to be passed to hooks.
InputEvent
The InputEvent class.
KeyboardEvent
The KeyboardEvent class.
MouseEvent
The MouseEvent class.
NodeRef
Wrapped Node reference for later use in Component lifecycle methods.
PointerEvent
The PointerEvent class.
ProgressEvent
The ProgressEvent class.
SubmitEvent
The SubmitEvent class.
Suspense
Suspend rendering and show a fallback UI until the underlying task completes.
TouchEvent
The TouchEvent class.
TransitionEvent
The TransitionEvent class.
UiEvent
The UiEvent class.
UseForceUpdateHandle
A handle which can be used to force a re-render of the associated function component.
UseReducerDispatcher
Dispatcher handle for use_reducer and use_reducer_eq hook
UseReducerHandle
State handle for use_reducer and use_reducer_eq hook
UseStateHandle
State handle for the use_state hook.
UseStateSetter
Setter handle for use_state and use_state_eq hook
WheelEvent
The WheelEvent class.

Traits§

BaseComponent
The common base of both function components and struct components.
Component
Components are the basic building blocks of the UI in a Yew app. Each Component chooses how to display itself using received props and self-managed state. Components can be dynamic and interactive by declaring messages that are triggered and handled asynchronously. This async update mechanism is inspired by Elm and the actor model used in the Actix framework.
FunctionProvider
Trait that allows a struct to act as Function Component.
Hook
A trait that is implemented on hooks.
Properties
Trait for building properties for a component
Reducible
A trait that implements a reducer function of a type.
TargetCast
A trait to obtain a generic event target.
TearDown
Trait describing the destructor of use_effect hook.
ToHtml
A trait implemented for types be rendered as a part of a Html.

Functions§

create_portal
Render children into a DOM node that exists outside the hierarchy of the parent component.
set_event_bubbling
Set, if events should bubble up the DOM tree, calling any matching callbacks.
use_callback
Get a immutable reference to a memoized Callback. Its state persists across renders. It will be recreated only if any of the dependencies changes value.
use_context
Hook for consuming context values in function components. The context of the type passed as T is returned. If there is no such context in scope, None is returned. A component which calls use_context will re-render when the data of the context changes.
use_effect
use_effect is used for hooking into the component’s lifecycle and creating side effects.
use_effect_with
This hook is similar to use_effect but it accepts dependencies.
use_force_update
This hook is used to manually force a function component to re-render.
use_memo
Get a immutable reference to a memoized value.
use_mut_ref
This hook is used for obtaining a mutable reference to a stateful value. Its state persists across renders.
use_node_ref
This hook is used for obtaining a NodeRef. It persists across renders.
use_reducer
This hook is an alternative to use_state. It is used to handle component’s state and is used when complex actions needs to be performed on said state.
use_reducer_eq
use_reducer but only re-renders when prev_state != next_state.
use_state
This hook is used to manage state in a function component.
use_state_eq
use_state but only re-renders when prev_state != next_state.

Type Aliases§

AttrValue
Attribute value
Children
A type used for accepting children elements in Component::Properties.
ChildrenWithProps
A type used for accepting children elements in Component::Properties and accessing their props.
Html
A type which expected as a result of view function implementation.
HtmlResult
An enhanced type of Html returned in suspendible function components.

Attribute Macros§

func
function_component
hook

Derive Macros§

Properties