Ogunmoroti Dammy
Ogunmoroti Dammy

Reputation: 21

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

enter image description here

Upvotes: 0

Views: 1600

Answers (2)

Nisharg Shah
Nisharg Shah

Reputation: 19532

Please read the documentation first before post any questions. Visit https://react-bootstrap.github.io/components/toasts/

change

import { Toast } from 'react-bootstrap';

with

import Toast from 'react-bootstrap/Toast'

Upvotes: 2

Adam Stawarek
Adam Stawarek

Reputation: 331

Change your import to import { Toast } from 'react-bootstrap/Toast'

Upvotes: 0

Related Questions