Seems like the preferred modern function declaration style is:
const showTestAlert = () => {
alert('test')
}
As opposed to declaring the function like this:
function showTestAlert(){
alert('test')
}
This function might get called downstream in an event handler like this:
onClick={x => {showTestAlert()}}
But why is the first style the preferred style these days? Does it bring any particular benefits to yhe table over the traditional declaration style? Also, what is the proper way to accomodate the fact that js doesn't "hoist" the function written in the first style like it does for the second style?