#Leptos: want to change the absolute position of an element every five seconds
5 messages · Page 1 of 1 (latest)
5 messages · Page 1 of 1 (latest)
the problem is that you put thread_rng in a variable
let mut rng = rand::thread_rng();
and then tried to use it in another thread
you can only use thread_rng on the current thread
so first move that line to inside the first thread closure let scheduler = thread::spawn(|| {
second, get rid of the thread_a and thread_b; you shouldn't need them
just call set_x and set_y straightforwardly