试图导入错误:'Toast'没有从'react-bootstrap'导出。

问题描述 投票:0回答:1
import React from 'react';
import { Toast } from 'react-bootstrap';

export function Confirmation({ toggle }) {
        return (
            <Toast onClose={() => toggle(false)}>
                <Toast.Header>
                        <strong className="mr-auto">Your Order Is In The Oven!</strong>
                        <small>just now</small>
            </Toast.Header>
            <Toast.Body>
                Your delicious pizza will be with you in 30 minutes!
            </Toast.Body>
            </Toast>
        );
}

enter image description here

javascript reactjs react-native bootstrap-4 react-bootstrap
1个回答
1
投票

在发布任何问题之前,请先阅读文档。请访问 https:/react-bootstrap.github.iocomponentstoasts。

变化

从'react-bootstrap'导入{ Toast }。

从'react-bootstrapToast'导入Toast。


0
投票

改变你的导入,从'react-bootstrapToast'导入{ Toast }。

© www.soinside.com 2019 - 2024. All rights reserved.