标签: javascript reactjs react-native ecmascript-6 redux
我想通过功能组件的上下文向树中传递一些道具 这几乎是应用程序的顶部。有没有办法实现这一目标,或者我们应该声明ES6 / createClass反应组件?
createClass
由于
答案 0 :(得分:4)
您无法使用功能组件向儿童传递上下文
答案 1 :(得分:0)
像往常一样定义contextTypes:
import codecs codecs.open(file_name, 'r', 'utf8')
可以使用小提琴:https://jsfiddle.net/69z2wepo/55601/。