updateHeightPlaceholder = ({
  domNode,
  parentData,
  getPosition,
}: {
  domNode: HTMLElement,
  parentData: NodeData,
  getPosition: GetPosition,
}) => {
  const parentDomNode = parentData.domNode;
  const parentBoundingBox = parentData.boundingBox;

  if (!parentDomNode || !parentBoundingBox) {
    return;
  }

  // We need to find the height of the container *without* the placeholder.
  // Since it's possible that the placeholder might already be present,
  // we first set its height to 0.
  // This allows the container to collapse down to the size of just its
  // content (plus container padding or borders if any).
  applyStylesToDOMNode({ domNode, styles: { height: '0' } });

  // Find the distance by which the container would be collapsed by elements
  // leaving. We compare the freshly-available parent height with the original,
  // cached container height.
  const originalParentHeight = parentBoundingBox.height;
  const collapsedParentHeight = getPosition(parentDomNode).height;
  const reductionInHeight = originalParentHeight - collapsedParentHeight;

  // If the container has become shorter, update the padding element's
  // height to take up the difference. Otherwise set its height to zero,
  // so that it has no effect.
  const styles: Styles = {
    height: reductionInHeight > 0 ? `${reductionInHeight}px` : '0',
  };

  applyStylesToDOMNode({ domNode, styles });
}
updateHeightPlaceholder
An optional property to FlipMove is a `maintainContainerHeight` boolean.
This property creates a node that fills space, so that the parent
container doesn't collapse when its children are removed from the
document flow.