The state machine doesn't work...It's buggy to pass complex data to wasm, we need to use `Closure` instead of `Fn`, ref [gesture.rs][gesture] The syntax of the state machine is hard to use, need to refactor as below ## Components without state ```rust struct Hello { name: String, } impl LifeCyle for Hello { fn create(name: String) -> Self { Self { name } } fn render(&self) -> Center { Center::with(Text::with(&format!("Hello, {}", self.name))) } } ``` ## Components with state ```rust struct Counter { count: i32, } impl LifeCyle for Counter { fn create(count: i32) -> Self { Self { count } } fn render(&self) -> GestureDetector { GestureDetector::new( Text::with(format!("count: {}", &self.count)), ).register(Gesture::Tap, |&mut state| state.count += 1) } } ``` [gesture]: https://github.com/elvisjs/elvis/blob/master/crates/core/src/gesture.rs
This issue appears to be discussing a feature request or bug report related to the repository. Based on the content, it seems to be still under discussion. The issue was opened by clearloop and has received 0 comments.