4 ms·
JSX is not only not required, it's sugar that breaks referential transparency: https://medium.com/@david.chambers/jsx-violates-referential-transparency-83261aa2
by dakom 8y ago
JSX is not only not required, it's sugar that breaks referential transparency: https://medium.com/@david.chambers/jsx-violates-referential-transparency-83261aa2c2b2 https://medium.com/@david.chambers/jsx-violates-referential-...
Personally I still use it, but I think it's fair to say that as much as JSX was created for a reason, it's made optional for a reason too.
- jakelazaroff 8y agoJSX doesn't violate referential transparency. A component either is referentially transparent, or it isn't; nothing about how it's invoked changes that. Put another way: React calls your components, not you. You pass the component function itself to React.createElement, not its result.
- dakom 8y ago> You pass the component function itself to React.createElement, not its result. JSX prevents you from being able to do this directly. For example, <() => "hello" /> is illegal.
- deleted 8y ago[deleted]