pixijs / pixi-react

Write PIXI apps using React declarative style
https://pixijs.io/pixi-react/
MIT License
2.42k stars 180 forks source link

Bug: Cannot read properties of undefined (reading 'alternate') #458

Open b13nxx opened 1 year ago

b13nxx commented 1 year ago

Current Behavior

I get the following error when I use the latest version of the React library:

Uncaught TypeError: Cannot read properties of undefined (reading 'alternate')
    at getNearestMountedFiber (react-reconciler.development.js:496:14)

Is it just me or is there a problem with the latest React version?

Expected Behavior

Expected to run smoothly

Steps to Reproduce

Tried to run this code:

import { BlurFilter } from 'pixi.js';
import { Stage, Container, Sprite, Text } from '@pixi/react';
import { useMemo } from 'react';

export const MyComponent = () =>
{
  const blurFilter = useMemo(() => new BlurFilter(4), []);

  return (
    <Stage>
      <Sprite
        image="https://pixijs.io/pixi-react/img/bunny.png"
        x={400}
        y={270}
        anchor={{ x: 0.5, y: 0.5 }}
      />

      <Container x={400} y={330}>
        <Text text="Hello World" anchor={{ x: 0.5, y: 0.5 }} filters={[blurFilter]} />
      </Container>
    </Stage>
  );
};

Environment

Possible Solution

No response

Additional Information

No response