diff --git a/src/constants/PixiReactIgnoredProps.ts b/src/constants/PixiReactIgnoredProps.ts index 82e1bbac..88fd5fed 100644 --- a/src/constants/PixiReactIgnoredProps.ts +++ b/src/constants/PixiReactIgnoredProps.ts @@ -1,3 +1,6 @@ import { PixiToReactEventPropNames } from './EventPropNames'; -export const PixiReactIgnoredProps = Object.freeze(Object.keys(PixiToReactEventPropNames)); +export const PixiReactIgnoredProps = Object.freeze([ + ...Object.keys(PixiToReactEventPropNames), + 'draw', +]); diff --git a/src/helpers/createInstance.ts b/src/helpers/createInstance.ts index 33ff5c2b..d065fd27 100644 --- a/src/helpers/createInstance.ts +++ b/src/helpers/createInstance.ts @@ -1,4 +1,5 @@ import { ReactToPixiEventPropNames } from '../constants/EventPropNames'; +import { PixiReactIgnoredProps } from '../constants/PixiReactIgnoredProps'; import { applyProps } from './applyProps'; import { catalogue } from './catalogue'; import { convertStringToPascalCase } from './convertStringToPascalCase'; @@ -30,7 +31,7 @@ export function createInstance( // Get the class from an imported Pixi.js namespace const PixiComponent = catalogue[name]; - const pixiProps = gentleCloneProps(props); + const pixiProps = gentleCloneProps(props, PixiReactIgnoredProps); // Clone event props Object.entries(props).forEach(([key, value]) => diff --git a/src/helpers/gentleCloneProps.ts b/src/helpers/gentleCloneProps.ts index 839daf08..9b65dbca 100644 --- a/src/helpers/gentleCloneProps.ts +++ b/src/helpers/gentleCloneProps.ts @@ -1,4 +1,3 @@ -import { PixiReactIgnoredProps } from '../constants/PixiReactIgnoredProps'; import { ReactIgnoredProps } from '../constants/ReactIgnoredProps'; import { gentleClone } from './gentleClone'; @@ -8,5 +7,5 @@ export function gentleCloneProps( additionalIgnoredProps: readonly string[] = [], ) { - return gentleClone(props, ReactIgnoredProps.concat(PixiReactIgnoredProps, additionalIgnoredProps)); + return gentleClone(props, ReactIgnoredProps.concat(additionalIgnoredProps)); }