News for hackers. Stuff that matters.
Re:Understanding React Compiler by recursive on Saturday June 29, 2024 @11:08AM (#40831128)
Not calling App. Creating a react element with a reference to the function. The reconciler will call it later, asynchronously. Put in some console logs and see the order of operations for yourself.

Also, try calling App and see what happens if it uses hooks.

Re:Understanding React Compiler by throwAGIway on Saturday June 29, 2024 @04:58PM (#40833313)
The createElement function is called immediately, and it immediately calls your component function. I don't think this is a significant difference. Many libraries accept a callback and I'm really not ready to call all that a framework just based on that.
Re:Understanding React Compiler by recursive on Saturday June 29, 2024 @06:57PM (#40833856)
createElement is immediate. The component function call is not. It may never be called. Try const a = <App />;

App() will never be called.

Re:Understanding React Compiler by throwAGIway on Sunday June 30, 2024 @02:40AM (#40835511)
Yeah, it will be called when you call render as in my original comment. Again, I don't think that passing a callback makes a framework.
Re:Understanding React Compiler by recursive on Sunday June 30, 2024 @11:31AM (#40837750)
When you combine that with the fact that you can't invoke the function directly, this seems like the textbook definition to me. Agree to disagree I guess.