Comments (2)
Poking around a bit, it looks like using the following works:
pub fn app() -> Element {
let mut num = use_server_future(get_next_number);
rsx! {
div {
onclick: move |e| async move {
queue_effect(move || {
if let Some(num) = &mut num {
num.restart();
}
});
},
if let Some(num) = num {
match num.value().as_ref() {
Some(num) => match num.as_ref() {
Ok(num) => rsx! { p { "Next number is {num}" } },
Err(e) => rsx! { p { "Loading next number failed, {e}" } },
},
None => rsx! { p { "Loading..." } }
}
}
}
}
}
Is this the recommended work around? If so, this may be a nice addition to the Event Handlers page.
from dioxus.
Fixed in #2488
from dioxus.
Related Issues (20)
- rsx! macro do not know `aspect-ratio`/`aspect_ratio`
- Copied the todomvc example code but not worked HOT 1
- Failed to install the latest development dioxus-cli through git. HOT 4
- Allow SSG to generate content with resources pending HOT 3
- Multiple router support, for decoupled re-usable components. HOT 4
- `dx serve` panic: Could not receive a socket - the devtools could not boot - the port is likely already in use HOT 2
- Client-side error only in release mode on 0.6.0-alpha.2: Uncaught TypeError: root is undefined / Cannot read properties of undefined (reading 'appendChild') HOT 2
- dx serve a desktop project panics on latest git version
- Link href does not include the config's `base_path`.
- Consider automatically configuring `server_fn`'s server url using the `base_path` from `Dioxus.toml`
- Better document limitations of file pickers in liveview
- `use_branched_signal` Hook to convert from `ReadOnlySignal` to `Signal` HOT 2
- External component breaks fullstack with custom Tokio/Axum HOT 6
- `dx bundle` panics for Desktop on Windows HOT 3
- Add lints for hooks in conditional branches (`&&` + `||`)
- `dx bundle` does not work.
- Fullstack example auth is panicking HOT 2
- R
- Dropping files (`ondrop`) doesn't work on Windows HOT 3
- Destructuring tuples panics #[component] macro HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dioxus.