Module freya::prelude

source ·
Expand description

Useful imports.

Re-exports

  • pub use dioxus_core;
  • pub use dioxus_hot_reload;
  • pub use crate::launch::*;
  • pub use crate::plugins::*;

Modules

Macros

  • Alias for Cow::Borrowed, because that’s used a million times so shortening it is nice. Makes the code more readable.
  • Example usage:
  • Start the hot reloading server with the current directory as the root
  • The rsx! macro makes it easy for developers to write jsx-style markup in their components.
  • The rsx! macro makes it easy for developers to write jsx-style markup in their components.
  • Create FooThemeWith structs without having to deal with the verbose syntax.
  • A helper macro for using hooks and properties in async environments.
  • This macro has three arguments separator by commas.

Structs

Enums

Constants

Traits

  • A trait for any storage backing type.
  • Any component that implements the ComponentFn trait can be used as a component.
  • A trait for giving a type a useful default value.
  • A dependency is a trait that can be used to determine if a effect or selector should be re-run.
  • A dependency is a trait that can be used to determine if a effect or selector should be re-run.
  • A trait for anything that has a dynamic list of attributes
  • A value that can be converted into an attribute value
  • A trait that allows various items to be converted into a dynamic node for the rsx macro
  • Every “Props” used for a component must implement the Properties trait. This trait gives some hints to Dioxus on how to memoize the props and some additional optimizations that can be made. We strongly encourage using the derive macro to implement the Properties trait automatically as guarantee that your memoization strategy is safe.
  • A trait for states that can be read from like crate::Signal, crate::GlobalSignal, or crate::ReadOnlySignal. You may choose to accept this trait as a parameter instead of the concrete type to allow for more flexibility in your API. For example, instead of creating two functions, one that accepts a crate::Signal and one that accepts a crate::GlobalSignal, you can create one function that accepts a Readable type.
  • An extension trait for Readable<Option> that provides some convenience methods.
  • An extension trait for Readable<Vec> that provides some convenience methods.
  • A trait for a storage backing type. (RefCell, RwLock, etc.)
  • A enhanced version of the From trait that allows with more flexibility.
  • A enhanced version of the Into trait that allows with more flexibility.
  • Common trait for editable texts
  • A trait to allow results to be thrown upwards to the nearest Error Boundary
  • A trait for states that can be read from like crate::Signal, or crate::GlobalSignal. You may choose to accept this trait as a parameter instead of the concrete type to allow for more flexibility in your API. For example, instead of creating two functions, one that accepts a crate::Signal and one that accepts a crate::GlobalSignal, you can create one function that accepts a Writable type.
  • An extension trait for Writable<Option> that provides some convenience methods.
  • An extension trait for Writable<Vec> that provides some convenience methods.

Functions

Type Aliases

Attribute Macros

  • Streamlines component creation. This is the recommended way of creating components, though you might want lower-level control with more advanced uses.
  • Derive props for a component within the component definition.

Derive Macros

  • Derive macro generating an impl of the trait Default.