This is a very simple question so apologies, but why do functions in class components/classes just follow the structure:
toggleTape(){
//some block of code
}
Whereas when you use functions inside a function component it seems like we follow the function declaration style of:
const toggleTape = () => {
//some block of code
}
Building on this, I noticed that whenever a function is within a javascript class it follows this first format, so I’m guessing React class components is just extending this rule about formatting functions differently when it’s in a class. I would just love to understand why functions are formatted differently in class components/classes rather than remembering it as some arbitrary rule. Any help would be greatly appreciated. Thanks!