Component Naming Conventions in Svelte
📖 Scenario: You are building a simple Svelte app that shows a list of fruits. To keep your code clean and easy to understand, you will practice naming your components properly.
🎯 Goal: Create a Svelte component named FruitList.svelte that displays a list of fruits. Follow proper component naming conventions by using PascalCase for the component file and component name.
📋 What You'll Learn
Create a Svelte component file named
FruitList.svelte.Use PascalCase for the component file name and component name.
Inside the component, define a list of fruits as an array.
Render the list of fruits using an each block.
Export the component properly.
💡 Why This Matters
🌍 Real World
Naming components clearly helps teams understand and maintain Svelte apps easily, especially when apps grow larger.
💼 Career
Following naming conventions is a key skill for frontend developers working with Svelte or other component-based frameworks.
Progress0 / 4 steps