This is a simple React application that displays a list of items and allows users to add new items to the list.
- Install Dependencies:
npm install
For Windows Command Prompt or PowerShell, you can use the same command.
- Run the Project: npm run dev
dev
: Runvite
for development.build
: Build the project using TypeScript and Vite.lint
: Lint the code using ESLint.preview
: Preview the production build using Vite.
-
Main Dependencies:
- React
- React DOM
- React Hook Form
- Bootstrap
- Zod
- @hookform/resolvers
-
Development Dependencies:
- TypeScript
- Vite
- ESLint
- @typescript-eslint/parser
- @typescript-eslint/eslint-plugin
- @vitejs/plugin-react
- Accepts an array of items (strings) as a prop.
- Renders each item in an unordered list (
<ul>
).
- Maintains an array of items in the state, initialized with sample items.
- Renders the
ItemList
component, passing the items from the state as props. - Includes an input field for users to enter a new item and a button to add the item to the list.
- When the button is clicked, the new item is added to the list, and the input field is cleared.
- Uses functional components and hooks (e.g.,
useState
). - Ensures the application is free of console errors and warnings.
- Code is clean, readable, and well-structured.