re: React Beginner Question Thread ⚛ VIEW POST

re: As someone that comes from a Vue background, conditionally rendering things in React look a bit cumbersome to me. In Vue, I just use a v-if directi...

This is one of the big philosophical and opinion differences between people who prefer Angular/Ember/Vue and people who prefer React.

React users generally point to the phrase "it's just Javascript" as a positive thing. Flow control and conditional rendering uses normal JS if statements and conditions, rendering lists is normal JS loops and array methods, and so on. There's no special templating mini-languages needed. Render methods also give you the full power of JS to write whatever logic you need.

People who prefer template-based rendering usually emphasize things like the ability to have designers edit HTML directly, and finding templates easier to read.

Both are valid approaches, and it really is a dividing line based on your own preferences. I personally am very happy with using JS-based rendering logic, and have no interest in using templates, but YMMV.

code of conduct - report abuse