Is it possible (and is it OK) to use fat arrow functions for Lifecycle methods in React?
componentWillMount = () => { }
My IDE shows it is incorrect, but I saw in different application
You technically can do it but there is really no reason to do so. It may even hurt performance as it will not be included in the prototype and can therefore not be reused.
Also see this issue in the react github repo where the same question was asked.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With