Feat: view -> render

This commit is contained in:
Jonathan Kelley committed 2021-02-28 21:21:17 -05:00
1 parent 10a236fc65
commit c8bb392cad
24 files changed
+204 -48

No files matched your search

+2 -2
View File
@@ -15,7 +15,7 @@ fn main() {
static App: FC<()> = |ctx, _| {
log::info!("Ran component");
use dioxus::builder::*;
ctx.view(|b| {
ctx.render(|b| {
div(b)
.child(text("hello"))
.listeners([on(b, "click", |_| {
@@ -24,7 +24,7 @@ static App: FC<()> = |ctx, _| {
})])
.finish()
})
// ctx.view(html! {
// ctx.render(html! {
// <div onclick={move |_| log::info!("button1 clicked!")}>
// "Hello"
// // <div class="flex items-center justify-center flex-col">
+1 -1
View File
@@ -6,7 +6,7 @@ fn main() {
}
static Example: FC<()> = |ctx, _props| {
ctx.view(html! {
ctx.render(html! {
<div>
"Hello world!"
</div>
+1 -1
View File
@@ -14,7 +14,7 @@ static Example: FC<()> = |ctx, props| {
log::debug!("Running component....");
ctx.view(html! {
ctx.render(html! {
// <div>
// <h1> "Hello, {name}" </h1>
// <button onclick={move |_| set_name("jack")}> "jack!" </button>
+1 -1
View File
@@ -10,7 +10,7 @@ fn main() {
console_error_panic_hook::set_once();
wasm_bindgen_futures::spawn_local(WebsysRenderer::start(|ctx, _| {
ctx.view(html! {
ctx.render(html! {
<div>
<div class="flex items-center justify-center flex-col">
<div class="flex items-center justify-center">