function applyStylesToDOMNode({
  domNode,
  styles,
}: {
  domNode: HTMLElement,
  styles: Styles,
}) {
  // Can't just do an object merge because domNode.styles is no regular object.
  // Need to do it this way for the engine to fire its `set` listeners.
  Object.keys(styles).forEach(key => {
    domNode.style.setProperty(hyphenate(key), styles[key]);
  });
}
React Flip Move
(c) 2016-present Joshua Comeau

These methods read from and write to the DOM.
They almost always have side effects, and will hopefully become the
only spot in the codebase with impure functions.