Best Practices
A summary:
- Reactivity: Use
track()with&[]lazy destructuring to create reactive variables you can read and write directly - Strings: Use direct double-quoted text children for static text, and
{}for JavaScript expressions - Effects: Use
effect()for side effects that depend on reactive values - Components: Keep components focused and type props with TypeScript interfaces or type aliases
- Styling: Use scoped
<style>elements for component-specific styles - Collections: Use
RippleArray,RippleObject,RippleMap, andRippleSetfor reactive collections instead of regular mutable objects
