Why do functions in class components need to be structered differently than when in function components?

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!

As you correctly assumed, this is nothing React specific – but due to the Javascript class syntax. Functions in classes are called methods. They are class fields – similar to object properties – and written accordingly.
It seems worth reviewing Javascript classes before starting with React:
https://www.codecademy.com/courses/learn-intermediate-javascript/lessons/classes/exercises/introduction