|
|
|
|
|
by batiste
3220 days ago
|
|
> So for you using a map with a ternary operator over a list of objects in JSX is perfectly fine and you can't see what is wrong I don't really know JSX much and without a specific example this is pointless to discuss. But basically JSX is syntactic sugar over javascript. A ternary is just a "if" condition so I don't see where is the issue here. Are you really using a template language devoid of conditionals? Even mustache the "logic-less" template has a form of it. > The XAML file, as the HTML layer, should be completely devoid of logic and should delegate the whole work to the underlying model The role of the model is and has always been to handle /business/ logic not presentational logic. If you put your dirty presentational logic inside my models I can tell you I will /never never/ accept your pull request. |
|
* You don't know JSX
* You have no idea of the specific example posted in this thread that I'm speaking of
* You have no idea about WPF and what is a view model
But nonetheless you feel entitled to discuss about things in which you have zero knowledge. This is the JSX code posted in this thread:
<div> {listOfThings.map(thing => thing.isX ? <X thing={thing} /> <Y thing={thing} /> )} </div>
Instead of this monstrosity in XAML would be like this: <ItemsControl ItemsSource={Binding ListOfThings} />
But of course for you is better the JSX code. Luckily for me you will never have to review any of my pull requests, I seriously doubt that you can accept something that you don't understand.