Merge branch 'master' into jk/remove_node_safety

This commit is contained in:
Jonathan Kelley committed 2021-10-28 17:09:51 -04:00
commit db0004758c
45 files changed
+156 -156

No files matched your search

+1 -1
View File
@@ -1,6 +1,6 @@
# Examples
Most of these examples are run through webview so you don't need the dioxus cli installed to preview the functionality.
Most of these examples are run through webview so you don't need the Dioxus CLI installed to preview the functionality.
These examples are fully-fledged micro apps. They can be ran with the `cargo run --example XYZ`
+2 -2
View File
@@ -15,10 +15,10 @@
//! For now, this example shows how to use coroutines used with use_state.
//!
//!
//! ## What is a Couroutine?
//! ## What is a Coroutine?
//!
//! A coroutine is a function that can be paused and resumed. It can be paused internally through "await" or externally
//! using the `TaskHandle` API. Within a coroutine, you may execute asynchonous code, that modifies values captured when
//! using the `TaskHandle` API. Within a coroutine, you may execute asynchronous code, that modifies values captured when
//! the coroutine was initiated. `use_state` always returns the same setter, so you don't need to worry about
fn main() {
+1 -1
View File
@@ -1,4 +1,4 @@
//! Example: realworld usage of hydration
//! Example: real-world usage of hydration
//! ------------------------------------
//!
//! This example shows how to pre-render a page using dioxus SSR and then how to rehydrate it on the client side.
+1 -1
View File
@@ -1,7 +1,7 @@
//! Example: Reducer Pattern
//! -----------------
//!
//! This example shows how to encapsulate sate in dioxus components with the reducer pattern.
//! This example shows how to encapsulate state in dioxus components with the reducer pattern.
//! This pattern is very useful when a single component can handle many types of input that can
//! be represented by an enum.
+2 -2
View File
@@ -43,7 +43,7 @@ fn main() {
}
/// When trying to return "nothing" to Dioxus, you'll need to specify the type parameter or Rust will be sad.
/// This type alias specifices the type for you so you don't need to write "None as Option<()>"
/// This type alias specifies the type for you so you don't need to write "None as Option<()>"
const NONE_ELEMENT: Option<()> = None;
use baller::Baller;
@@ -104,7 +104,7 @@ pub static Example: FC<()> = |(cx, props)| {
// Matching
// Matching will throw a Rust error about "no two closures are the same type"
// To fix this, call "render" method or use the "in" syntax to produce VNodes.
// There's nothing we can do about it, sorry :/ (unless you want *really* unhygenic macros)
// There's nothing we can do about it, sorry :/ (unless you want *really* unhygienic macros)
{match true {
true => rsx!(cx, h1 {"Top text"}),
false => cx.render(rsx!( h1 {"Bottom text"}))
+1 -1
View File
@@ -4,7 +4,7 @@
//!
//! This example shows how to use the dioxus_desktop crate to build a basic desktop application.
//!
//! Under the hood, the dioxus_desktop crate bridges a native Dioxus VirtualDom with a custom prebuit application running
//! Under the hood, the dioxus_desktop crate bridges a native Dioxus VirtualDom with a custom prebuilt application running
//! in the webview runtime. Custom handlers are provided for the webview instance to consume patches and emit user events
//! into the native VDom instance.
//!
+1 -1
View File
@@ -4,7 +4,7 @@
//!
//! This example shows how to use the dioxus_desktop crate to build a basic desktop application.
//!
//! Under the hood, the dioxus_desktop crate bridges a native Dioxus VirtualDom with a custom prebuit application running
//! Under the hood, the dioxus_desktop crate bridges a native Dioxus VirtualDom with a custom prebuilt application running
//! in the webview runtime. Custom handlers are provided for the webview instance to consume patches and emit user events
//! into the native VDom instance.
//!