function getHTMLDirIfDifferent(
    dir: BidiDirection,
    otherDir: BidiDirection,
): ?HTMLDir {
  invariant(
    isStrong(dir),
    '`dir` must be a strong direction to be converted to HTML Direction',
  );
  invariant(
    isStrong(otherDir),
    '`otherDir` must be a strong direction to be converted to HTML Direction',
  );
  return dir === otherDir ? null : getHTMLDir(dir);
}
Get string value to be used for `dir` HTML attribute or `direction` CSS
property, but returns null if `dir` has same value as `otherDir`.
`null`.