File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -99,12 +99,25 @@ module MvuComponent =
9999 let canReuseMvuComponent ( prev : Widget ) ( curr : Widget ) =
100100 let prevData =
101101 match prev.ScalarAttributes with
102- | ValueSome attrs when attrs.Length > 0 -> attrs[ 0 ]. Value :?> MvuComponentData
102+ | ValueSome attrs ->
103+ let scalarAttrsOpt =
104+ attrs |> Array.tryFind( fun scalarAttr -> scalarAttr.Key = Data.Key)
105+
106+ match scalarAttrsOpt with
107+ | None -> failwithf " Component widget must have a body"
108+ | Some value -> value.Value :?> MvuComponentData
109+
103110 | _ -> failwith " Component widget must have a body"
104111
105112 let currData =
106113 match curr.ScalarAttributes with
107- | ValueSome attrs when attrs.Length > 0 -> attrs[ 0 ]. Value :?> MvuComponentData
114+ | ValueSome attrs ->
115+ let scalarAttrsOpt =
116+ attrs |> Array.tryFind( fun scalarAttr -> scalarAttr.Key = Data.Key)
117+
118+ match scalarAttrsOpt with
119+ | None -> failwithf " Component widget must have a body"
120+ | Some value -> value.Value :?> MvuComponentData
108121 | _ -> failwith " Component widget must have a body"
109122
110123 // NOTE: Somehow using = here crashes the app and prevents debugging...
You can’t perform that action at this time.
0 commit comments