카테고리 없음
Til (2023.01.03)
react native todo 수정,삭제 삭제 alert로 취소,삭제 버튼을 준 후 삭제를 누르면 실행 alert문법은 Alert.alert("제목", "내용", [{ text:"버튼1", style: "3가지" }, { text:"버튼2", style: "3가지" }]); 아래 코드에서 onPress로 todo.id를 매개변수로 준다. 매개변수를 id로 받아서 filter를 이용해 todos안의 todo.id와 같지 않은 것만 출력 const deleteTodo = (id) => { //alert쓰는 방식 제목,내용을 쓰고 버튼은 배열안에 객체를 넣어서 씀 style로 세가지 모양가능 Alert.alert("Todo 삭제", "정말 삭제하시겠습니까?", [ { text: "취소", style: "ca..