【发布时间】:2018-11-17 01:04:16
【问题描述】:
我们都知道constructor -> componentWillMount -> componentDidMount 是执行顺序。
现在当 redux 发挥作用并尝试在我们的组件生命周期中访问 redux 属性时。 connect 将执行的顺序是什么,以便 数据是可用的生命周期方法 忽略和数据更新到 redux。可能性是
1. Connect (DATA AVAILABLE) -> constructor & componentWillMount & componentDidMount
2. constructor -> Connect (DATA AVAILABLE) -> componentWillMount & componentDidMount
3. constructor -> componentWillMount -> Connect (DATA AVAILABLE) -> componentDidMount
4. constructor -> componentWillMount -> componentDidMount -> Connect (DATA AVAILABLE)
顺序一致还是取决于加载的数据?
react 和 react native 有什么不同
并且可以将 redux 属性定义为 PropType 中要求的
【问题讨论】:
-
您能否提供您的用例以更好地理解问题
-
我希望它是一个一般场景并且没有任何具体的用例@abby37
标签: reactjs react-native redux react-redux