0

I am interested in ES6 and ES5 transpiring using React and Babel.

If you look at the picture above, the hooks converted to es5 style are called as anonymous functions, why is the first factor is 0?

Original ES5 Code transfiled ES5 Code

Blundering Philosopher
  • 6,245
  • 2
  • 43
  • 59
PINOT
  • 1
  • 1
  • https://stackoverflow.com/questions/40967162/what-is-the-meaning-of-this-code-0-function-in-javascript I could find the answer to my question here. – PINOT Sep 02 '20 at 11:34
  • https://2ality.com/2015/12/references.html#references-in-real-world-code – Yury Tarabanko Sep 02 '20 at 11:42
  • Does this answer your question? [Why does babel rewrite imported function call to (0, fn)(...)?](https://stackoverflow.com/questions/32275135/why-does-babel-rewrite-imported-function-call-to-0-fn) – Yury Tarabanko Sep 02 '20 at 11:43

0 Answers0