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
I can get it to render if i do a single level of if, else if, and else statements
But if i use the code that has been commented out instead, which seems to be the same code, but so i have just nested ifelse statements, then it gives the following error. is the idea that i should proceed trying to figure out how to use Box::new if i want to use nested ifelse statements?
The text was updated successfully, but these errors were encountered:
Yeah, that's stretching the limits of what auto_branch can do atm, the control flow analysis is pretty dumb because I don't want to pull in syn and kill compile times. It's fixable, but for now you might have to disable auto_branch and wrap the view! invocations in appropriate BranchN enum.
Yeah, that's stretching the limits of what auto_branch can do atm, the control flow analysis is pretty dumb because I don't want to pull in syn and kill compile times. It's fixable, but for now you might have to disable auto_branch and wrap the view! invocations in appropriate BranchN enum.
Thanks, I got it to work with Branch3
...
use kobold::branching::Branch3;
...
#[component]
fn Cell(col: usize, row: usize, state: &Hook<State>) -> impl View + '_ {
let value = state.source.get_text(&state.rows[row][col]);
if state.editing == (Editing::Cell { row, col }) {
let onchange = state.bind(move |state, e: Event<InputElement>| {
state.rows[row][col] = Text::Owned(e.target().value().into());
state.editing = Editing::None;
});
Branch3::A(view! {
<td.edit>
{ ref value }
<input.edit {onchange} value={ ref value } />
</td>
})
// https://github.com/maciejhirsz/kobold/issues/51
} else {
let ondblclick = state.bind(move |s, _| s.editing = Editing::Cell { row, col });
if value.contains("0x") {
Branch3::B(view! {
<td {ondblclick}>
{ ref value }
<QRForTask {value} />
</td>
})
} else {
Branch3::C(view! {
<td {ondblclick}>{ ref value }</td>
})
}
}
}
ltfschoen
added a commit
to ltfschoen/kobold
that referenced
this issue
Apr 3, 2023
I can get it to render if i do a single level of
if
,else if
, andelse
statementsBut if i use the code that has been commented out instead, which seems to be the same code, but so i have just nested
if
else
statements, then it gives the following error. is the idea that i should proceed trying to figure out how to use Box::new if i want to use nestedif
else
statements?The text was updated successfully, but these errors were encountered: