From f7a0eb7bf31b9da291a8d2afad40f98a6de0961f Mon Sep 17 00:00:00 2001 From: Trezy Date: Sat, 31 Aug 2024 21:43:13 -0500 Subject: [PATCH] fix: ensure `draw` calls are being run --- src/constants/PixiReactIgnoredProps.ts | 5 ++++- src/helpers/createInstance.ts | 3 ++- src/helpers/gentleCloneProps.ts | 3 +-- 3 files changed, 7 insertions(+), 4 deletions(-) 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)); }