|
@@ -14,7 +14,7 @@ use dioxus_html as dioxus_elements;
|
|
|
|
|
|
#[test]
|
|
#[test]
|
|
fn app_runs() {
|
|
fn app_runs() {
|
|
- static App: FC<()> = |cx| {
|
|
|
|
|
|
+ static App: FC<()> = |cx, props| {
|
|
//
|
|
//
|
|
cx.render(rsx!( div{"hello"} ))
|
|
cx.render(rsx!( div{"hello"} ))
|
|
};
|
|
};
|
|
@@ -25,7 +25,7 @@ fn app_runs() {
|
|
|
|
|
|
#[test]
|
|
#[test]
|
|
fn fragments_work() {
|
|
fn fragments_work() {
|
|
- static App: FC<()> = |cx| {
|
|
|
|
|
|
+ static App: FC<()> = |cx, props| {
|
|
cx.render(rsx!(
|
|
cx.render(rsx!(
|
|
div{"hello"}
|
|
div{"hello"}
|
|
div{"goodbye"}
|
|
div{"goodbye"}
|
|
@@ -39,7 +39,7 @@ fn fragments_work() {
|
|
|
|
|
|
#[test]
|
|
#[test]
|
|
fn lists_work() {
|
|
fn lists_work() {
|
|
- static App: FC<()> = |cx| {
|
|
|
|
|
|
+ static App: FC<()> = |cx, props| {
|
|
cx.render(rsx!(
|
|
cx.render(rsx!(
|
|
h1 {"hello"}
|
|
h1 {"hello"}
|
|
{(0..6).map(|f| rsx!(span{ "{f}" }))}
|
|
{(0..6).map(|f| rsx!(span{ "{f}" }))}
|
|
@@ -52,7 +52,7 @@ fn lists_work() {
|
|
|
|
|
|
#[test]
|
|
#[test]
|
|
fn conditional_rendering() {
|
|
fn conditional_rendering() {
|
|
- static App: FC<()> = |cx| {
|
|
|
|
|
|
+ static App: FC<()> = |cx, props| {
|
|
cx.render(rsx!(
|
|
cx.render(rsx!(
|
|
h1 {"hello"}
|
|
h1 {"hello"}
|
|
{true.then(|| rsx!(span{ "a" }))}
|
|
{true.then(|| rsx!(span{ "a" }))}
|
|
@@ -69,13 +69,13 @@ fn conditional_rendering() {
|
|
|
|
|
|
#[test]
|
|
#[test]
|
|
fn child_components() {
|
|
fn child_components() {
|
|
- static App: FC<()> = |cx| {
|
|
|
|
|
|
+ static App: FC<()> = |cx, props| {
|
|
cx.render(rsx!(
|
|
cx.render(rsx!(
|
|
{true.then(|| rsx!(Child { }))}
|
|
{true.then(|| rsx!(Child { }))}
|
|
{false.then(|| rsx!(Child { }))}
|
|
{false.then(|| rsx!(Child { }))}
|
|
))
|
|
))
|
|
};
|
|
};
|
|
- static Child: FC<()> = |cx| {
|
|
|
|
|
|
+ static Child: FC<()> = |cx, props| {
|
|
cx.render(rsx!(
|
|
cx.render(rsx!(
|
|
h1 {"hello"}
|
|
h1 {"hello"}
|
|
h1 {"goodbye"}
|
|
h1 {"goodbye"}
|
|
@@ -88,7 +88,7 @@ fn child_components() {
|
|
|
|
|
|
#[test]
|
|
#[test]
|
|
fn suspended_works() {
|
|
fn suspended_works() {
|
|
- static App: FC<()> = |cx| {
|
|
|
|
|
|
+ static App: FC<()> = |cx, props| {
|
|
let title = use_suspense(cx, || async { "bob" }, |cx, f| cx.render(rsx! { "{f}"}));
|
|
let title = use_suspense(cx, || async { "bob" }, |cx, f| cx.render(rsx! { "{f}"}));
|
|
cx.render(rsx!("hello" { title }))
|
|
cx.render(rsx!("hello" { title }))
|
|
};
|
|
};
|