Skip to content

Commit e808f22

Browse files
authored
Merge pull request #535 from pixijs/520-bug-events-on-a-sprite-dont-work-on-initial-run-using-vite
Restore `draw` method being run for `<graphics>` components
2 parents 86b833d + f7a0eb7 commit e808f22

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed
+4-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
import { PixiToReactEventPropNames } from './EventPropNames';
22

3-
export const PixiReactIgnoredProps = Object.freeze(Object.keys(PixiToReactEventPropNames));
3+
export const PixiReactIgnoredProps = Object.freeze([
4+
...Object.keys(PixiToReactEventPropNames),
5+
'draw',
6+
]);

src/helpers/createInstance.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { ReactToPixiEventPropNames } from '../constants/EventPropNames';
2+
import { PixiReactIgnoredProps } from '../constants/PixiReactIgnoredProps';
23
import { applyProps } from './applyProps';
34
import { catalogue } from './catalogue';
45
import { convertStringToPascalCase } from './convertStringToPascalCase';
@@ -30,7 +31,7 @@ export function createInstance(
3031
// Get the class from an imported Pixi.js namespace
3132
const PixiComponent = catalogue[name];
3233

33-
const pixiProps = gentleCloneProps(props);
34+
const pixiProps = gentleCloneProps(props, PixiReactIgnoredProps);
3435

3536
// Clone event props
3637
Object.entries(props).forEach(([key, value]) =>

src/helpers/gentleCloneProps.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { PixiReactIgnoredProps } from '../constants/PixiReactIgnoredProps';
21
import { ReactIgnoredProps } from '../constants/ReactIgnoredProps';
32
import { gentleClone } from './gentleClone';
43

@@ -8,5 +7,5 @@ export function gentleCloneProps(
87
additionalIgnoredProps: readonly string[] = [],
98
)
109
{
11-
return gentleClone(props, ReactIgnoredProps.concat(PixiReactIgnoredProps, additionalIgnoredProps));
10+
return gentleClone(props, ReactIgnoredProps.concat(additionalIgnoredProps));
1211
}

0 commit comments

Comments
 (0)