As you know, React automatically delegates the entire event to a document, as does a large list:
handleTodo(){}
render() { todos.map((todo)=><li onClick={this.handleTodo}>{todo.name}</li>)}
will create a to-do list, but the onClick event will delegate the document, right?
BUT, a question about a related function.
handleTodo(todo){}
render(){todos.map((todo)=><li onClick={this.handleTodo.bind(this,todo)}>{todo.name}</li>)}
for each todo, there is another related function due to different parameters. when will these functions be generated? Does React delegate these functions to a document? what if a huge list, are there thousands of related functions that cause performance issues?
source
share