Skip to content
Discussion options

You must be logged in to vote

Ah-ha! of course I find it after posting, but I've found an explanation here: #3638 (comment)

When the Resource is read inside the Memo, the Memo looks up the tree searching for a
Suspense. However, it looks up the tree starting from where the Memo is created, not
from where the Memo is read. Because the Memo is created above/outside the Suspense,
it doesn't find it.

You can fix this by delaying the creation of the Memo until you're actually inside the Suspense.

And indeed, the following works without emitting any warnings.

#[component]
pub fn ContractViewC() -> impl IntoView {
    let visitor: Resource<Visitor> = expect_context();
    let (req_mode, set_mode) = signal::<Option<&'static s…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by duelafn
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant