|
|
|
|
|
by winterbe
2984 days ago
|
|
The difference is that the JSX snippet is translated in plain JavaScript which means you can automatically check for syntax errors, type errors (when using TypeScript or Flow) and semantical errors (by writing simple unit tests), whereas the PHP snippet is just a big mess. JSX also runs on clients, servers and mobile devices which is a big plus to me. This is fine: <?php
if (condition) {
?>
<div>whatever</div>
<?php
{
?>
this not: if (isLoggedIn) {
return <UserGreeting />;
{
|
|