Intended behavior: https://github.com/reactwg/react-18/discussions/31

Sandbox: https://codesandbox.io/s/react-18-layouteffect-semantics-forked-m02w5

Expected: when suspended content is hidden and then shown, we get layout cleanup followed by layout setup.
Actual: only layout cleanup happens.


ref(instanceToUse);
      }
    } else {
      if (__DEV__) {
        if (!ref.hasOwnProperty('current')) {
          console.error(
            'Unexpected ref object provided for %s. ' +
              'Use either a ref-setter function or React.createRef().',
            getComponentNameFromFiber(finishedWork),
          );
        }
      }
      ref.current = instanceToUse;
    }
  }
}
function commitDetachRef(current: Fiber) {
  const currentRef = current.ref;
  if (currentRef !== null) {
    if (typeof currentRef === 'function') {
      if (
        enableProfilerTimer &&
        enableProfilerCommitHooks &&
        current.mode & ProfileMode
      ) {
        try {
          startLayoutEffectTimer();
          currentRef(null);
        } finally {
          recordLayoutEffectDuration(current);