top | item 37444080

(no title)

parminya | 2 years ago

JSX and PHP are actually seriously different. When you break out of PHP, you're just outputting text to standard output. When you're using JSX syntax, you're constructing Javascript objects that can be manipulated using standard javascript techniques. Anyone who believes they're comparable seriously doesn't understand the task that is before them.

discuss

order

fjfuvucucuc|2 years ago

Oh please, I professionally use both daily (enjoy them both), but even I can see JSX is just PHP with extra steps.

thewix|2 years ago

Though not JSX, with TSX you get type checking with your markup.

wildrhythms|2 years ago

My reading of this thread is that people are comparing JSX as a templating language to PHP as a templating language, splicing PHP <? ... ?> into HTML like how we have { ... } in JSX. At the end of the day React lets you write a function that returns HTML just like a PHP file.