Components
Components
Section titled “Components”Learn how to build reusable components in aincraft.
Component Basics
Section titled “Component Basics”Components are the building blocks of your application.
Creating Components
Section titled “Creating Components”Create a new component:
export default function MyComponent() { return <div>Hello World</div>;}Pass data to components using props:
function Greeting({ name }) { return <h1>Hello, {name}!</h1>;}Component Composition
Section titled “Component Composition”Compose smaller components into larger ones.
Lifecycle Hooks
Section titled “Lifecycle Hooks”Manage component lifecycle with hooks:
onMount- When component is mountedonUnmount- When component is unmountedonChange- When component state changes
Best Practices
Section titled “Best Practices”- Keep components small and focused
- Use descriptive names
- Document component props