BEGINNER • HTML and CSS Basics
Sprint: reduce bundle size #2
This lesson focuses on reduce bundle size for a dashboard with charts interface. You will use: npm run dev | document.querySelector('.btn') | npx create-react-app my-app. The content is designed for practical frontend development.
Code Example
// Accessible component
<button
aria-label="Add to cart"
aria-pressed={isInCart}
onClick={handleClick}
>
Add to Cart
</button>
// Objective: reduce bundle sizeCommands & References
- npm run dev
- document.querySelector('.btn')
- npx create-react-app my-app
Lab Steps
- Set up with: npm run dev
- Build or refactor the component for the scenario.
- Validate accessibility and performance.
- Propose one improvement for production.
Exercises
- Add one accessibility enhancement.
- Implement one performance optimization.
- Write one unit test for this component.