Replies: 4 comments 2 replies
-
|
can you tell what is the problem? please |
Beta Was this translation helpful? Give feedback.
-
let current_user = RwSignal::new(CurrentUser { me: None });
OnceResource::new_blocking(async move {
let response = get_current_user_private_data().await;
match response {
Ok(value) => {
current_user.update(|input| {
input.me = Some(value);
});
}
Err(error) => {
log!("{error:?}");
}
}
});You should not write to a signal inside the async block of a Resource, because during server rendering that So, If you find yourself creating a resource ( You should probably either pass the resource itself through context, or wait for the value of the user via Suspense and pass that value through context. |
Beta Was this translation helpful? Give feedback.
-
Screencast.From.2025-09-26.15-35-52.mp4 |
Beta Was this translation helpful? Give feedback.
-
|
i'm confused |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
when i update the context value, other places that use context value won't update
please take look at the following link
https://github.com/MFJoyBoy/my-problems-with-leptos/tree/context-update
Beta Was this translation helpful? Give feedback.
All reactions