import React, { useRef } from "react";
import generateUniqueId from "../utils/uniqueId";
export default function useId(prefix) {
  const initialRender = useRef('');

  if (initialRender.current) {
    return initialRender.current;
  }

  ;
  let uid = generateUniqueId(prefix);
  initialRender.current = uid;
  return uid;
}