import {StyleSheet, View, Text, FlatList, Alert} from 'react-native';
const submitHandler = text => {
if (text.length > 3) {
setTodos(prevTodos => {
return [{text: text, key: uuid().toString()}, ...prevTodos];
});
} else {
Alert.alert('OOPS!', 'Todos must be over 3chars long...', [
{text: 'Understood', onPress: () => console.log('alert closed')},
{text: 'So What!', onPress: () => console.log('alert closed')},
]);
}
};
Alert.alert('제목', '내용', [{버튼:text:'버튼제목', 기능},{버튼}])
'모바일 > React-native' 카테고리의 다른 글
React-native/키보드 사라지게하기 (0) | 2020.01.30 |
---|---|
React-native/To Do App/추가 기능/Text Input (0) | 2020.01.28 |
React-native/ To Do App 만들기/리스트 출력하기 && 항목삭제 (0) | 2020.01.27 |
React-native/ To Do App 만들기/ 상단 제목 (0) | 2020.01.25 |