<!--
  Note: if the issue is about documentation or the website, please file it at:
  https://github.com/reactjs/reactjs.org/issues/new
-->

**Do you want to request a *feature* or report a *bug*?**
bug
**What is the current behavior?**
example: https://codesandbox.io/s/04393o3k6w
If the `LogProps` is child of `M.Provider`, and `M.Consumer` is used in its children.
When the `M.Provider` is updating, even if the `LogProps` is wrapped in a component that  never updates, it can still be triggered by the callback of `React.forwardRef`, and updates the `LogProps`.

**What is the expected behavior?**
the `LogProps` shouldn't update when the root component had updated, whether or not  `M.Consumer` is used in its children;

**Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React?**

it's used react@16.3

applyDerivedStateFromProps,
} from './ReactFiberClassComponent';
import {
  mountChildFibers,
  reconcileChildFibers,
  cloneChildFibers,
} from './ReactChildFiber';
import {processUpdateQueue} from './ReactUpdateQueue';
import {NoWork, Never} from './ReactFiberExpirationTime';
import {AsyncMode, StrictMode} from './ReactTypeOfMode';
import MAX_SIGNED_31_BIT_INT from './maxSigned31BitInt';
const {getCurrentFiberStackAddendum} = ReactDebugCurrentFiber;
let didWarnAboutBadClass;
let didWarnAboutGetDerivedStateOnFunctionalComponent;
let didWarnAboutStatelessRefs;
if (__DEV__) {
  didWarnAboutBadClass = {};
  didWarnAboutGetDerivedStateOnFunctionalComponent = {};
  didWarnAboutStatelessRefs = {};
}
export default function<T, P, I, TI, HI, PI, C, CC, CX, PL>(
  config: HostConfig<T, P, I, TI, HI, PI, C, CC, CX, PL>,
  hostContext: HostContext<C, CX>,
  legacyContext: LegacyContext,
  newContext: NewContext,
  hydrationContext: HydrationContext<C, CX>,
  scheduleWork: (fiber: Fiber, expirationTime: ExpirationTime) => void,
  computeExpirationForFiber: (fiber: Fiber) => ExpirationTime,
) {
  const {shouldSetTextContent, shouldDeprioritizeSubtree} = config;