DEV Community

[Comment from a deleted post]
Collapse
hamishwhc profile image
HamishWHC

That snippet is valid, provided the parentheses are changed to a React fragment (<> </>):

return <>
  <h1>This is a react component</h1>
  <h2>The date is {Date.now()}</h2>
  <h3>Your number from python script is 5</h3>
</>
Enter fullscreen mode Exit fullscreen mode
Collapse
vonheikemen profile image
Heiker

Even with that, it still isn't valid javascript.