Hacker News new | past | comments | ask | show | jobs | submit login

JSX 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.




> 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.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: