Closed
Description
Problem
Right now when testing Svelte components from what I've seen in the wild and in my own project, passing in props becomes repetitive and seems to be the main Component initialization option used.
To be more precise this statement:
const { /** results */ } = render(Comp, { props: { myProp: 0 } })
Examples in the wild:
Potential Solution
To avoid breaking changes, maybe the render function can accept both direct props AND Component options. So both the following would be valid:
const { /** results */ } = render(Comp, { myProp: 0 })
const { /** results */ } = render(Comp, { props: { myProp: 0 } })
One way to implement this is to contain a dictionary of the Client side component options, and (1) if any are present then pass in the options, (2) otherwise pass in the object directly as props.