我将 2 个值传递给子组件:
- 要显示的对象列表
 - 删除功能。
 
我使用 .map() 函数来显示我的对象列表(如react教程页面中给出的示例),但该组件中的按钮在onClick渲染时触发该函数(它不应该在渲染时触发)。我的代码如下所示:
module.exports = React.createClass({
    render: function(){
        var taskNodes = this.props.todoTasks.map(function(todo){
            return (
                <div>
                    {todo.task}
                    <button type="submit" onClick={this.props.removeTaskFunction(todo)}>Submit</button>
                </div>
            );
        }, this);
        return (
            <div className="todo-task-list">
                {taskNodes}
            </div>
        );
    }
});
我的问题是:为什么onClick函数会在渲染时触发以及如何让它不触发?