Skip to content

Commit

Permalink
Cleanup example code
Browse files Browse the repository at this point in the history
  • Loading branch information
snelsi committed Jan 12, 2024
1 parent 5996935 commit 126917a
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions examples/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,18 +44,14 @@ type MainFramePropsType = {
// #### 1. React hook (new in v6.0.0)
const MainFrame = ({ onHideLeftPanel }: MainFramePropsType) => {
const [count, setCount] = useState(0);
const [isLoading, setIsLoading] = useState(false);
const [isLoading, setIsLoading] = useState(true);
const { width, height, ref } = useResizeDetector<HTMLDivElement>();
// { refreshMode: 'debounce', refreshRate: 2000, skipOnMount: true }

useEffect(() => {
const i = setTimeout(() => {
setIsLoading(isLoading => !isLoading);
}, 5000);
const i = setTimeout(() => setIsLoading(false), 1000);

return () => {
clearTimeout(i);
};
return () => clearTimeout(i);
}, []);

useEffect(() => {
Expand Down

0 comments on commit 126917a

Please sign in to comment.