Skip to content

Commit

Permalink
Merge pull request #510 from pixijs/506-bug-usetick-not-ticking-on-in…
Browse files Browse the repository at this point in the history
…itial-load-during-vite-dev

Fix `useTick` during initial load when using server components
  • Loading branch information
trezy authored Jul 29, 2024
2 parents 28a6868 + 775cc4d commit 43b471b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/hooks/useTick.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useEffect } from 'react';
import { invariant } from '../helpers/invariant.ts';
import { useApp } from './useApp.ts';
import { useIsomorphicLayoutEffect } from './useIsomorphicLayoutEffect.ts';

import type { TickerCallback } from 'pixi.js';
import type { TickCallbackOptions } from '../typedefs/TickCallbackOptions.ts';
Expand Down Expand Up @@ -35,7 +35,7 @@ function useTick<T>(
invariant(typeof callback === 'function', '`useTick` needs a callback function.');

// eslint-disable-next-line consistent-return
useEffect(() =>
useIsomorphicLayoutEffect(() =>
{
const ticker = app?.ticker;

Expand Down

0 comments on commit 43b471b

Please sign in to comment.