I stuck a bit with a problem:
I have a svelte component, which works with a number of props:
<script>
export let foo;
export let bar;
</script>
But also, I'd like to pass some props to my HTML element directly. So my solution is:
<script>
export let foo;
export let bar;
const {
foo,
bar,
...other
} = $$props;
</script>
<button {...other}>
Some action
</button>
This one has a huge problem: When I change some props like "class", the component wouldn't be updated.
<MyComponent {foo} {bar} class={condition ? 'one' : 'two'} />
What is a better way to solve this case? I mean, I have to support different props, not only "class" one. How could I pass the rest of the props to an HTML-element