Comments (4)
Worth a note: this was encountered at first when doing loading screen stuff with server functions and use_server_future()
- but this is a more minimal and targeted sample. The broken bit is unrelated to server fns.
from dioxus.
@jkelleyrtp it seems the bug is not fixed. Tested with git 821a650, same test code as above.
from dioxus.
Sorry for the delay - we've put in many fixes regarding async since April and I think this might already be fixed - but I'll let @ealmloff double check.
from dioxus.
This updated version of the example reproduction works:
// [dependencies]
// dioxus = { path = "/Users/evanalmloff/Desktop/Github/dioxus/packages/dioxus", features = ["web"] }
// dioxus-logger = "0.5.1"
// gloo-timers = { version = "0.3.0", features = ["futures"] }
// tracing = "0.1.40"
use std::time::Duration;
use dioxus::prelude::*;
use tracing::Level;
fn main() {
dioxus_logger::init(Level::TRACE).unwrap();
launch(Broken)
}
#[component]
fn Broken() -> Element {
let signal = use_signal(|| false);
let _future = use_resource(move || async move { signal() });
let action = move |_| {
spawn_forever(async move {
let d = DropDetector;
let mut signal = signal.clone();
tracing::info!("Start of signal set");
signal.set(true);
tracing::info!("Set to true");
gloo_timers::future::sleep(Duration::from_millis(500)).await;
tracing::info!("Timer finished");
signal.set(false);
tracing::info!("Signal set to false");
drop(d);
});
};
rsx! {
div {
div { "State: {signal}" }
button { onclick: action, "press me" }
}
}
}
struct DropDetector;
impl Drop for crate::DropDetector {
fn drop(&mut self) {
tracing::warn!("Dropped DropDetector!");
}
}
from dioxus.
Related Issues (20)
- 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
- Support for the `onclose` event handler
- `launch` should not be in prelude and `LaunchBuilder` and associated configs need to be reworked
- Implement module namespacing in `routable` derive macro HOT 1
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.