sycamore-rs / sycamore

A library for creating reactive web apps in Rust and WebAssembly
https://sycamore-rs.netlify.app
MIT License
2.79k stars 148 forks source link

Nested component click event error #655

Closed ys2rice2yangsong closed 8 months ago

ys2rice2yangsong commented 8 months ago

Describe the bug A clear and concise description of what the bug is.

To Reproduce Steps to reproduce the behavior:

[component(inline_props)]

fn T(cx:Scope,title: String, level: i32) -> View { let tt = title.clone(); let tt_clone = title.clone(); view!{ cx, ( if level<5 { view!{ cx, div{ T( title="afasdf".to_string(), level=level+1 ) } } } else { view!{ cx, p( on:click=move|e| { console!("asdfasdf".to_string()); } ){ (tt) } } } ) } }

Expected behavior

Screenshots error info: Uncaught Error: closure invoked recursively or after being dropped

Environment

Additional context Add any other context about the problem here.

lukechu10 commented 8 months ago

Duplicate of #654 and #433