I've noticed recently that a lot of people are declaring functions in their functional components using the function
keyword instead of using arrow functions. I'm wondering if there is a performance reason for this, or is a style thing, or something else?
For example say I have a component ShowNote
with a form and a function to validate it, I could declare it like this:
const ShowNote = () => {
function validateForm() {
return content.length > 0;
}
...
or
const ShowNote = () => {
const validateForm = () => {
return content.length > 0;
}
...