我正在学习React
,遇到了Context API
,在查看示例代码时,我发现它有render () function
根据我的理解,上下文反应类组件是用来管理状态的,所以不清楚为什么我们需要使用render((函数?
class组件具有render
方法。类组件可以访问Context API,但render
方法与Context API完全解耦。