Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restore draw method being run for <graphics> components #535

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/constants/PixiReactIgnoredProps.ts
Original file line number Diff line number Diff line change
@@ -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',
]);
3 changes: 2 additions & 1 deletion src/helpers/createInstance.ts
Original file line number Diff line number Diff line change
@@ -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';
Expand Down Expand Up @@ -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]) =>
Expand Down
3 changes: 1 addition & 2 deletions src/helpers/gentleCloneProps.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { PixiReactIgnoredProps } from '../constants/PixiReactIgnoredProps';
import { ReactIgnoredProps } from '../constants/ReactIgnoredProps';
import { gentleClone } from './gentleClone';

Expand All @@ -8,5 +7,5 @@ export function gentleCloneProps(
additionalIgnoredProps: readonly string[] = [],
)
{
return gentleClone(props, ReactIgnoredProps.concat(PixiReactIgnoredProps, additionalIgnoredProps));
return gentleClone(props, ReactIgnoredProps.concat(additionalIgnoredProps));
}