【发布时间】:2021-05-26 05:18:28
【问题描述】:
我感到非常沮丧,因为似乎没有帖子可以解决我的问题。在父组件中,有一个存储对象列表的数组,以及一个附加到该列表的方法。 [这里有一个片段供参考]
在我的父组件的渲染方法中,我将此方法作为道具传递给我的子组件。
[第 79 行]
https://i.stack.imgur.com/fStiF.png
我的子组件尝试调用上述方法,在它的 render() in render's return, child component
https://i.stack.imgur.com/crN9T.png
但是由于某种原因,我得到一个错误 this.props.addPart is not a function
完整代码:
【问题讨论】: