Skip to content

Commit

Permalink
fix(runtime): 修复类组件生命周期不促发的问题
Browse files Browse the repository at this point in the history
兼容 react-redux 7.20.1+ 更改了内部 forwardedRef 变量名的改动:

reduxjs/react-redux#1553
https://github.com/reduxjs/react-redux/pull/1553/files
  • Loading branch information
Chen-jj committed Jul 27, 2020
1 parent c7edb18 commit 50316ae
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/taro-runtime/src/dsl/react.ts
Expand Up @@ -27,7 +27,11 @@ export function connectReactPage (
const isReactComponent = isClassComponent(R, component)

const inject = (node?: Instance) => node && injectPageInstance(node, id)
const refs = isReactComponent ? { ref: inject } : { forwardedRef: inject }
const refs = isReactComponent ? { ref: inject } : {
forwardedRef: inject,
// 兼容 react-redux 7.20.1+
reactReduxForwardedRef: inject
}

if (PageContext === EMPTY_OBJ) {
PageContext = R.createContext('')
Expand Down

0 comments on commit 50316ae

Please sign in to comment.