function useId(prefix = `id`) {
  const [id, setId] = React.useState(() => {
    if (serverHandoffCompleted) {
      return `${prefix}-${getId()}`
    }
    return null
  })

  useIsomorphicLayoutEffect(() => {
    if (id === null) {
      setId(`${prefix}-${getId()}`)
    }
  }, [getId])

  React.useEffect(() => {
    if (serverHandoffCompleted === false) {
      serverHandoffCompleted = true
    }
  }, [])

  return id
}
Generate a unique ID with an optional prefix prepended to it
@param {string} [prefix]
@returns {string}