Apart from needing to create a new function each time render is invoked, are there any other differences from using:
class {
on = () => true
render = () => <z on={this.on} />
}
vs
class {
render = () => <z on={() => true} />
}
For example, are there any optimizations that browsers make? Are there any implementation differences?
If there are zero differences, would it make sense for something like bable to transform the code to avoid creating the function in the render function?
{} => truesi not valid. And what is the purpose of having a function that always returns true ?render = () => {}won't work, will it? Like a half year ago I tried it and it generated an error in babel