Best Practices
A summary:
- Reactivity: Use
track()to create reactive values you read and write through.value - Text: Use JSX text 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: Put a scoped
<style>block beside the elements it styles, and assign a block to a variable to share it as a theme (apply) or class map - Collections: Use
RippleArray,RippleObject,RippleMap, andRippleSetfor reactive collections instead of regular mutable objects
