Skip to content

Commit

Permalink
fix: add better error handling for unavailable components
Browse files Browse the repository at this point in the history
  • Loading branch information
trezy committed Jun 3, 2024
1 parent 9018995 commit 6fe3973
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/helpers/createInstance.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,13 @@ export function createInstance(type, props)
// Get the class from an imported Pixi.js namespace
const TARGET = /** @type {new (...args: any[]) => any} */ (catalogue[name]);

if (!TARGET)
{
throw new Error(
`@react/pixi: ${name} is not part of the PIXI namespace! Did you forget to extend?`,
);
}

let instance;

// Create instance
Expand Down

0 comments on commit 6fe3973

Please sign in to comment.