Open chungwong opened 3 days ago
I get a panic related to running wasm-bindgen methods on non-wasm targets first. If you fix that issue by moving the body of the body_overflow
function into a web!{}
macro (which just passes through the inner code if the target is web), then the other panic goes away as well
I get a panic related to running wasm-bindgen methods on non-wasm targets first. If you fix that issue by moving the body of the
body_overflow
function into aweb!{}
macro (which just passes through the inner code if the target is web), then the other panic goes away as well
Wrapping it in to web! {}
did work. However, why is it related though? body_overflow
uses web_sys and hence it is web only but use_drop
triggered when Drawer
get destroyed. Isn't it all web only already?
I get a panic related to running wasm-bindgen methods on non-wasm targets first. If you fix that issue by moving the body of the
body_overflow
function into aweb!{}
macro (which just passes through the inner code if the target is web), then the other panic goes away as wellWrapping it in to
web! {}
did work. However, why is it related though?body_overflow
uses web_sys and hence it is web only butuse_drop
triggered whenDrawer
get destroyed. Isn't it all web only already?
Effects don't run on the server, but use_drop
does. It runs any time the component is dropped including during SSR rendering on the server. My guess is trying to recover from wasm bindgen error caused an odd state on the server which caused the error you saw
Problem
Demo: drawer branch in this repo
Description
Given the following Drawer component,
use_effect
is used to control theoverflow
property on the html body.use_drop
is used to clean up/reset the changes made tooverflow
.Starting the app and on http://127.0.0.1:8080, press F5 twice(once is enough for triggering but twice will present you the problem) to refresh the page and you will see the ValueDroppedError. I don't see any difference in my use case compared to the use_drop doc
Environment: