Skip to content

Commit

Permalink
refactor: move props outside of class definition to satisfy typechecker
Browse files Browse the repository at this point in the history
  • Loading branch information
shfx committed Mar 2, 2025
1 parent f37b2bd commit ec6c2ab
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions packages/playwright-ct-svelte/registerSource.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -73,15 +73,13 @@ window.playwrightMount = async (component, rootElement, hooksConfig) => {
throw new Error('JSX mount notation is not supported');

const componentCtor = asClassComponent(component.type);
const props = extractParams(component);

class App extends componentCtor {
constructor(options = {}) {
if (!isObjectComponent(component))
throw new Error('JSX mount notation is not supported');

super({
target: rootElement,
props: extractParams(component),
props,
...options
});
}
Expand Down

0 comments on commit ec6c2ab

Please sign in to comment.