docs: big updates to the reference
This commit is contained in:
1 parent
caf772cf24
commit
583fdfa561
57 files changed
+726
-247
No files matched your search
@@ -9,21 +9,18 @@
|
||||
//! - By using the fragment() method on the node factory
|
||||
|
||||
use dioxus::prelude::*;
|
||||
fn main() {}
|
||||
|
||||
// Returning multiple elements with rsx! or html!
|
||||
static Example1: FC<()> = |cx| {
|
||||
static App1: FC<()> = |cx| {
|
||||
cx.render(rsx! {
|
||||
h1 { }
|
||||
h2 { }
|
||||
h3 { }
|
||||
// {}
|
||||
// "hello world"
|
||||
})
|
||||
};
|
||||
|
||||
// Using the Fragment component
|
||||
static Example2: FC<()> = |cx| {
|
||||
static App2: FC<()> = |cx| {
|
||||
cx.render(rsx! {
|
||||
Fragment {
|
||||
div {}
|
||||
@@ -34,7 +31,7 @@ static Example2: FC<()> = |cx| {
|
||||
};
|
||||
|
||||
// Using the `fragment` method on the NodeFactory
|
||||
static Example3: FC<()> = |cx| {
|
||||
static App3: FC<()> = |cx| {
|
||||
cx.render(LazyNodes::new(move |fac| {
|
||||
fac.fragment_from_iter([
|
||||
fac.text(format_args!("A")),
|
||||
@@ -44,3 +41,11 @@ static Example3: FC<()> = |cx| {
|
||||
])
|
||||
}))
|
||||
};
|
||||
|
||||
pub static Example: FC<()> = |cx| {
|
||||
cx.render(rsx! {
|
||||
App1 {}
|
||||
App2 {}
|
||||
App3 {}
|
||||
})
|
||||
};
|
||||
Reference in new issue
Block a user