Is there a difference between the way this function returns? It works but I'm more so asking whether there are any performance differences between:
const someFunction = () => {
if(someVal){
return setState([...products, newProduct])
}
//... other stuff
}
Or
const someFunction = () => {
if(someVal){
setState([...products, newProduct])
return
}
//... other stuff
}