according to Airbnb React style guide, It's better to use a normal function for declaring stateless component, rather than use an Arrow function.
My question is why a normal function is better?
https://github.com/airbnb/javascript/tree/master/react#class-vs-reactcreateclass-vs-stateless
Asked
Active
Viewed 800 times
2
slideshowp2
- 63,310
- 57
- 191
- 365
samane yaghoobi
- 175
- 1
- 3
- 9
-
6Possible duplicate of [Why does the Airbnb style guide say that relying on function name inference is discouraged?](https://stackoverflow.com/questions/37288950/why-does-the-airbnb-style-guide-say-that-relying-on-function-name-inference-is-d) – Jibin Joseph Apr 21 '19 at 16:40
-
^This will answer your question. – Jibin Joseph Apr 21 '19 at 16:46
-
@jibin-joseph Thanks a lot it's really useful, but I couldn't understand the accepted answer deeply, I need more explanation about this concept. – samane yaghoobi Apr 21 '19 at 17:15
-
@SamaneYaghoobi This is a full dupe indeed. I've posted an answer and tried to keep it straight and simple, https://stackoverflow.com/a/55784719/3731501 – Estus Flask Apr 21 '19 at 17:43