Hacker News new | ask | show | jobs
by manigandham 2546 days ago
You don't have to, you can create a simple 1 line component to turn it into a declarative style.

It's the benefit of having a full language instead of a template DSL for rendering. Declarative syntax is easy inside of an imperative flow, doing the opposite tends to lead to problems though.

1 comments

You don't need a one line component, you can just declare an extra variable before your main JSX.

A redundant extra component is bad for performance.

I know. That's what the poster didn't like so I suggested an alternative.