7nik

Results 188 comments of 7nik

What about `adoptedStyleSheets`? It inserts styles without creating a node in the DOM. ```js connectedCallback() { const sheet = new CSSStyleSheet(); sheet.replaceSync(lightStyleSheet); // add styles to the closest shadowRoot or...

It's not really about runes but stores — if you declare a variable `state`, then `$state` is considered a store value, and thus, the error is that you are trying...

The first solution is impossible. Static analysis cannot cover all possible cases. IIRC, variables shadowing runes is intention behaviour - this allows the introduction of new runes without breaking existing...

> > BTW, due to this, your REPL is considered to be in legacy mode. > > What does that mean? Svelte 4 / non-rune mode. The mode can be...

It's more for Svelte 6, but what about replacing auto-subscription with an explicit subscription via a rune: ```js let myStoreVal = $store(myStore); myStoreVal = 42; // equivalent to myStore.set(42); //...

What is the point of limiting `children` type? Why your component cannot accept ` Peter ` or ``?

Can it even be type-checked? `Tab` expects exactly `TabItem`s in children, but for TS, there is no difference between `` and `` with compatible set of props.

For now, the best you can do is throwing an error ` must be inside ` when a component fails to get the right context.

But you can easily pass a prop with any name using spreading: ```jsx let props = { "=;123": 42 }; ```