Inspirce by : React Todo List App Tutorial - React JS Project Tutorial for Beginners
- Strat components by using
rafc - useState - to manage value input by users
- Define a function include multiple funtion
// funtion like task, toolComplete, deleteTodo, editTodo
const Todo = ({task, toggleComplete, deleteTodo, editTodo}) => {
}
- onClick - to call function
- use
console.logto check the vlaue - AI make mistake and misunderstand the code → need better tool
- Cursor response is pretty slow and not precise
- CodeGeeX is the best tool to check the code ( response fast and format is easy to read)
- Create environment by using
create-react-appand without setup issue - Delete installed file like
App.test,index.css,SetupTest.js
- "no function" error → add {} for {addTodo}
- when display "no function" check {} is inclued the text
- writedown my issue, and all possible solutions, try it step by step → I repeat wrong steps and it waste so much time
- use
console.logto check the value - Focus on
useStatepractice - Clone more project and learn their skill
- Check the code by using
CodeGeeX
- what's uuidv4 and how to use ?
- how to use
map
setTodos(todos.map(todo => todo.id === id ? {...todo, completed: !todo.completed} : todo))
- whole logic of to-do list app → I can't create on my own and without referecne