모바일/React-native

React-native/알림 기능 추가

Time Saver 2020. 1. 30. 11:27

import {StyleSheetViewTextFlatListAlertfrom 'react-native';

 

const submitHandler = text => {

    if (text.length > 3) {

      setTodos(prevTodos => {

        return [{text: textkey: 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:'버튼제목', 기능},{버튼}])