Closed XavDesbordes closed 2 months ago
Ah, it's because we don't apply indentation to formatted exprs in for/if loops - guess I didn't expect anyone to use multiline exprs in those cases! Should be simple enough to fix
I acknowledge being a jackass but it really eases the bulk of data I have to deal with. Do you recommend a specific strategy ?
Preparing the iterators out of the rsx!{}
block maybe ? (Genuinely open to suggestions to make the app the most efficient as possible)
You could extract out to a vec/iterator of elements - this could even be a separate function to clean things up a bit
let profile = data_full_profile.read();
let dummy = &profile.0.as_ref().unwrap().get().dummy_data_for_example[0];
let profiles = dummy.dummy_section.iter().zip(dummy.strs.iter()).map(|s| {
rsx! {
div { "Some rendered content {s}" }
}
});
rsx! {
div { {profiles} }
};
That's smart and I like it. Taken :+1: !
We still need to format these exprs - so I'll leave this issue open and fix it in #2230
Okay cool, should be released soon, your IDE (assuming you're using vscode) will autoupdate in the next day or so
@jkelleyrtp you rock, really !
Hi,
latest dioxus: using rsx! format on save in the dioxus plugin for Vs code. Linux
pictures worth 1000 words:
Normal loop in rust with my settings:
Multi scoped, normal rust (to see the behavior when an offset is applied):
inside rsx! block at top:
inside rsx! block:
here is the loop:
The wrecked indentation becomes a distraction, even more so in a longish
rsx!{}
Here to provide further info if needed.
Thanks!