feat: upgrade syntax
This commit is contained in:
1 parent
574d7fdb9e
commit
fd93ee89c1
64 files changed
+522
-437
No files matched your search
@@ -11,7 +11,7 @@
|
||||
use dioxus::prelude::*;
|
||||
|
||||
// Returning multiple elements with rsx! or html!
|
||||
static App1: FC<()> = |(cx, props)| {
|
||||
static App1: FC<()> = |cx, props| {
|
||||
cx.render(rsx! {
|
||||
h1 { }
|
||||
h2 { }
|
||||
@@ -20,7 +20,7 @@ static App1: FC<()> = |(cx, props)| {
|
||||
};
|
||||
|
||||
// Using the Fragment component
|
||||
static App2: FC<()> = |(cx, props)| {
|
||||
static App2: FC<()> = |cx, props| {
|
||||
cx.render(rsx! {
|
||||
Fragment {
|
||||
div {}
|
||||
@@ -31,7 +31,7 @@ static App2: FC<()> = |(cx, props)| {
|
||||
};
|
||||
|
||||
// Using the `fragment` method on the NodeFactory
|
||||
static App3: FC<()> = |(cx, props)| {
|
||||
static App3: FC<()> = |cx, props| {
|
||||
cx.render(LazyNodes::new(move |fac| {
|
||||
fac.fragment_from_iter([
|
||||
fac.text(format_args!("A")),
|
||||
@@ -42,7 +42,7 @@ static App3: FC<()> = |(cx, props)| {
|
||||
}))
|
||||
};
|
||||
|
||||
pub static Example: FC<()> = |(cx, props)| {
|
||||
pub static Example: FC<()> = |cx, props| {
|
||||
cx.render(rsx! {
|
||||
App1 {}
|
||||
App2 {}
|
||||
|
||||
Reference in new issue
Block a user