在我的反应项目中,我导入了这个:
import confirmDialog from '../../components/confirmDialog/ConfirmDialog';
当我添加底线时:
const [confirmDialog, SetConfirmDialog] = useState ({isOpen: false, title: '', subTitle: ''});
我收到以下错误:
Identifier 'confirmDialog' has already been declared
。
我也confirmDialog
像这样在 MyComponet 中使用:
<ConfirmDialog
ConfirmDialog={confirmDialog}
SetConfirmDialog={SetConfirmDialog}
/>