score:1

Can't you just set the initial state of the clientId directly. *Not tested

  const clientIdFromStore = JSON.parse(localStorage.getItem("pageSettingData") ?? {});
  const [clientId, setClientId] = useState(clientIdFromStore?.getData?.google_clientID);

Related Query

More Query from same tag