简体   繁体   English

尝试导入错误:“Toast”未从“react-bootstrap”导出

[英]Attempted import error: 'Toast' is not exported from 'react-bootstrap'

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>
        );
}

在此处输入图像描述

Please read the documentation first before post any questions.在发布任何问题之前,请先阅读文档。 Visit https://react-bootstrap.github.io/components/toasts/访问https://react-bootstrap.github.io/components/toasts/

change改变

import { Toast } from 'react-bootstrap';从'react-bootstrap'导入{吐司};

with

import Toast from 'react-bootstrap/Toast'从 'react-bootstrap/Toast' 导入 Toast

Change your import to import { Toast } from 'react-bootstrap/Toast'将导入更改为 import { Toast } from 'react-bootstrap/Toast'

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 尝试导入错误:'Jumbotron 未从'react-bootstrap'导出(导入为'Jumbo') - Attempted import error: 'Jumbotron is not exported from 'react-bootstrap' (imported as 'Jumbo') 尝试导入错误:'未从 - Attempted import error:' is not exported from 尝试导入错误:“getMoviesList”未从“./actions”导出; 反应错误 redux - Attempted import error: 'getMoviesList' is not exported from './actions'; error in react redux 反应错误“尝试导入错误:'TodoItem'未从'./Todoitem'导出。” - error in react " Attempted import error: 'TodoItem' is not exported from './Todoitem'. " 尝试导入错误:“Navigate”未从“react-router-dom”导出 - Attempted import error: 'Navigate' is not exported from 'react-router-dom' 尝试导入错误:“PrivateRoute”未从“react-router-dom”导出 - Attempted import error: 'PrivateRoute' is not exported from 'react-router-dom' 尝试导入错误:“路由”未从“react-router-dom”导出 - Attempted import error: 'Routes' is not exported from 'react-router-dom' 尝试导入错误:“useDispatch”未从“react-redux”导出 - Attempted import error: 'useDispatch' is not exported from 'react-redux' 尝试导入错误:“withRouter”未从“react-router”导出 - Attempted import error: 'withRouter' is not exported from 'react-router' 尝试导入错误:“Outlet”未从“react-router-dom”导出 - Attempted import error: 'Outlet' is not exported from 'react-router-dom
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM