如何在警报组件中添加InputText?

时间:2019-08-23 11:11:07

标签: javascript react-native alert

我有警报功能。我想输入警报以确认此拒绝确认。

export const showAlert = (title: string, body: string, buttons = [{ 
   text: 'Ok', onPress: () => {} }]) => {
   Alert.alert(title, body, buttons, { cancelable: true });
};
showAlert(
  t("reject_confirmation"),
  t("are_you_sure_to_reject_from_tasks"),
  [

    {
      text: t("cancel"),
      onPress: () => {},
    },

    {
      text: t("global_reject"),
      onPress: async () => {
        await this.runActionWithLoad(async () => {
          const url = "/Task/RejectByVillage";
          await request().post(url, { villageId, taskType: type });
          showToast(this.t("global_action_success"));
        });
      },
    },
  ]
);

在警报功能中,我想从本机添加<TextInput/>

0 个答案:

没有答案