[BUG] iOS 上的 Portal 问题,没有 expo
import React, {useState} from 'react';
import {SafeAreaView, View} from 'react-native';
import {
AlertDialog,
AlertDialogAction,
AlertDialogCancel,
AlertDialogContent,
AlertDialogDescription,
AlertDialogFooter,
AlertDialogHeader,
AlertDialogTitle,
AlertDialogTrigger,
} from '/components/ui/alert-dialog';
import {Button} from '/components/ui/button';
import {Portal} from '@rn-primitives/portal';
import {Text} from '~/components/ui/text/text.component';
export default function TestScreen() { const [showPortalTest, setShowPortalTest] = useState(false);
// Test portal directly const togglePortalTest = () => { setShowPortalTest(!showPortalTest); };
return ( <SafeAreaView style={{ flex: 1, justifyContent: 'center', alignItems: 'center', gap: 20, }}> Are you absolutely sure? This action cannot be undone. This will permanently delete your account and remove your data from our servers. Cancel Continue
{/* Direct portal test */}
<Button onPress={togglePortalTest}>
<Text>Toggle Direct Portal Test</Text>
</Button>
</SafeAreaView>
); }
内容来源: founded-labs/react-native-reusables