feat: check transition

This commit is contained in:
Nevo David 2024-03-10 13:52:07 +07:00
parent 6d39ce36f9
commit 2b310cfda2
1 changed files with 15 additions and 3 deletions

View File

@ -1,4 +1,11 @@
import { FC, useCallback, useEffect, useMemo, useState } from 'react';
import {
FC,
startTransition,
useCallback,
useEffect,
useMemo,
useState,
} from 'react';
import { UtcToLocalDateRender } from '@gitroom/react/helpers/utc.date.render';
import { Button } from '@gitroom/react/form/button';
import dayjs from 'dayjs';
@ -92,7 +99,9 @@ export const StarsTableComponent = () => {
const starsCallback = useCallback(
async (path: string) => {
setLoading(true);
startTransition(() => {
setLoading(true);
});
const data = await (
await fetch(path, {
body: JSON.stringify({
@ -102,7 +111,10 @@ export const StarsTableComponent = () => {
method: 'POST',
})
).json();
setLoading(false);
startTransition(() => {
setLoading(false);
});
return data;
},