[0.7] Ways of creating a non-Send Resource #3312
-
Hey all! I'm trying to upgrade my Leptos project from 0.6 -> 0.7, and one thing I'm stuck on is that the Resource |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
The answer here depends slightly on which kind of platform you're using. If you're using CSR, then the serialization/server-client part of Resource isn't necessary and you can use LocalResource, which doesn't have a If you're using SSR + hydration, then the problem is specifically that The added |
Beta Was this translation helpful? Give feedback.
The answer here depends slightly on which kind of platform you're using.
If you're using CSR, then the serialization/server-client part of Resource isn't necessary and you can use LocalResource, which doesn't have a
Send
bound.If you're using SSR + hydration, then the problem is specifically that
reqwest
uses types that areSend
on the server (and show up in docs asSend
, which is confusing!) but are!Send
in the WASM build. You might try taking a look at how I set this up in thehackernews
example: essentially usingSendWrapper
on the client.The added
Send
bound here is an unfortunate trade-off of allowing the reactive system and server rendering to support multithreading.