chore: rename ctx to cx
This commit is contained in:
1 parent
23c14078bb
commit
81382e7044
99 files changed
+789
-664
No files matched your search
@@ -8,8 +8,8 @@ Dioxus-webview is an attempt at making a simpler "Tauri" where creating desktop
|
||||
// main.rs
|
||||
#[async_std::main]
|
||||
async fn main() {
|
||||
dioxus_webview::new(|ctx| {
|
||||
let (count, set_count) = use_state(&ctx, || 0);
|
||||
dioxus_webview::new(|cx| {
|
||||
let (count, set_count) = use_state(&cx, || 0);
|
||||
html! {
|
||||
<div>
|
||||
<h1> "Dioxus Desktop Demo" </h1>
|
||||
|
||||
@@ -36,22 +36,22 @@ fn blah() {
|
||||
let handler = dioxus_liveview::new_handler()
|
||||
.from_directory("abc123") // serve a given directory as the root
|
||||
.with_context(|| SomeContext {}) // build out a new context for all of the server-rendered components to share
|
||||
.with_route(SERVER_RENDERED_KEY, |ctx: &ServerRendered| {
|
||||
.with_route(SERVER_RENDERED_KEY, |cx: &ServerRendered| {
|
||||
//
|
||||
})
|
||||
.with_route(SERVER_RENDERED_KEY, |ctx| {
|
||||
.with_route(SERVER_RENDERED_KEY, |cx| {
|
||||
//
|
||||
})
|
||||
.with_route(SERVER_RENDERED_KEY, |ctx| {
|
||||
.with_route(SERVER_RENDERED_KEY, |cx| {
|
||||
//
|
||||
})
|
||||
.with_route(SERVER_RENDERED_KEY, |ctx| {
|
||||
.with_route(SERVER_RENDERED_KEY, |cx| {
|
||||
//
|
||||
})
|
||||
.with_route(SERVER_RENDERED_KEY, |ctx| {
|
||||
.with_route(SERVER_RENDERED_KEY, |cx| {
|
||||
//
|
||||
})
|
||||
.with_route(SERVER_RENDERED_KEY, |ctx| {
|
||||
.with_route(SERVER_RENDERED_KEY, |cx| {
|
||||
//
|
||||
})
|
||||
// depend on the framework, build a different type of handler
|
||||
|
||||
@@ -17,8 +17,8 @@ fn main() {
|
||||
.expect("Webview finished");
|
||||
}
|
||||
|
||||
static Example: FC<()> = |ctx| {
|
||||
ctx.render(html! {
|
||||
static Example: FC<()> = |cx| {
|
||||
cx.render(html! {
|
||||
<div>
|
||||
<svg class="octicon octicon-star v-align-text-bottom"
|
||||
viewBox="0 0 14 16" version="1.1"
|
||||
@@ -36,8 +36,8 @@ static Example: FC<()> = |ctx| {
|
||||
</div>
|
||||
})
|
||||
};
|
||||
// static Example: FC<()> = |ctx| {
|
||||
// ctx.render(rsx! {
|
||||
// static Example: FC<()> = |cx| {
|
||||
// cx.render(rsx! {
|
||||
// div {
|
||||
// class: "flex items-center justify-center flex-col"
|
||||
// div {
|
||||
|
||||
Reference in new issue
Block a user