Svelte · Senior · Question 52 of 75
What should you consider when designing a Svelte component library?
- ✓Correct answer: Typed props and snippets, forwarding rest props and attachments to the root element, CSS custom properties for theming, and avoiding global state
- 2Using stores for all props
- 3Shipping precompiled CSS for every possible theme
Explanation
Spreading ...rest onto the element lets consumers add attributes, handlers and attachments without the library knowing about them.