You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When rendering a list of components again with a different list, where the first list contains some None (ie. empty nodes), there is a panic:
panicked at /home/ochrons/.cargo/registry/src/index.crates.io-6f17d22bba15001f/dioxus-core-0.5.1/src/diff/node.rs:142:49:
called `Option::unwrap()` on a `None` value
$core::option::unwrap_failed::hb5bacfb0dd292085 @ Zhef_bg.wasm:0x513587
$dioxus_core::diff::node::<impl dioxus_core::nodes::VNode>::find_last_element::h2fbafeb25fa6485a @ Zhef_bg.wasm:0x24a677
$dioxus_core::diff::iterator::<impl dioxus_core::virtual_dom::VirtualDom>::create_and_insert_after::hdf1b487b5c58bd2e @ Zhef_bg.wasm:0x48288f
$dioxus_core::diff::iterator::<impl dioxus_core::virtual_dom::VirtualDom>::diff_non_keyed_children::h825ddb6722191889 @ Zhef_bg.wasm:0x236220
$dioxus_core::diff::iterator::<impl dioxus_core::virtual_dom::VirtualDom>::diff_non_empty_fragment::h9f386364ef278952 @ Zhef_bg.wasm:0x2588a3
$dioxus_core::diff::node::<impl dioxus_core::nodes::VNode>::diff_dynamic_node::hccca532b469dca0c @ Zhef_bg.wasm:0x19bbcf
$dioxus_core::diff::node::<impl dioxus_core::nodes::VNode>::diff_node::{{closure}}::he12ecb157d0a2bc4 @ Zhef_bg.wasm:0x4e38
I'm rendering a li with changing number of children
let description:implIterator<Item = Option<VNode>>
...
rsx! {
li {{description}}}
some of the items in the iterator are None. The generated HTML looks like
<lidata-node-hydration="103"><!--node-id104-->Shape <!--#--><!--node-id105--> into <!--#--></li>
if I replace the empty nodes with some valid rsx (empty string), this problem doesn't occur and then the HTML looks like
<lidata-node-hydration="118"><!--node-id119-->Shape <!--#--><!--node-id120--><!--node-id121--> into <!--#--><!--node-id122--><!--node-id123--><!--#--></li>
Expected behavior
Shouldn't panic, but render the new list of items correctly.
Screenshots
If applicable, add screenshots to help explain your problem.
Environment:
Dioxus version: 0.5.1
Rust version: 1.78
OS info: Win11 WSL2
App platform: fullstack
The text was updated successfully, but these errors were encountered:
Problem
When rendering a list of components again with a different list, where the first list contains some
None
(ie. empty nodes), there is a panic:I'm rendering a li with changing number of children
some of the items in the iterator are
None
. The generated HTML looks likeif I replace the empty nodes with some valid
rsx
(empty string), this problem doesn't occur and then the HTML looks likeExpected behavior
Shouldn't panic, but render the new list of items correctly.
Screenshots
If applicable, add screenshots to help explain your problem.
Environment:
The text was updated successfully, but these errors were encountered: