next.js TypeError:Cannot read properties of undefined(阅读'item')[closed]

u0sqgete  于 2023-06-22  发布在  其他
关注(0)|答案(1)|浏览(127)

**已关闭。**此问题为not reproducible or was caused by typos。目前不接受答复。

此问题是由打印错误或无法再重现的问题引起的。虽然类似的问题在这里可能是on-topic,但这个问题的解决方式不太可能帮助未来的读者。
13天前关闭。
Improve this question
这是我在尝试运行下面给出的代码时不断得到的错误。

import React from 'react'
import { Accordion} from 'react-bootstrap/Accordion';
import { ToastContainer } from 'react-toastify';
const myaccordion = () => {
  return (
    <>
    <Accordion defulatActivateKey="0" className='mt-5 p-3'>
        <Accordion.item eventKey="0" className="item" >
            <Accordion.header>Accordion Header #1</Accordion.header>
            <Accordion.body>
            Lorem Ipsum is simply dummy text of the printing and typesetting industry.
            </Accordion.body>
        </Accordion.item>
        <Accordion.item eventKey="2" className="item">
            <Accordion.header>Accordion Header #1</Accordion.header>
            <Accordion.body>
            Lorem Ipsum is simply dummy text of the printing and typesetting industry.
            </Accordion.body>
        </Accordion.item>
        <Accordion.item eventKey="3" className="item">
            <Accordion.header>Accordion Header #1</Accordion.header>
            <Accordion.body>
            Lorem Ipsum is simply dummy text of the printing and typesetting industry.
            </Accordion.body>
        </Accordion.item>
    </Accordion>
    <ToastContainer />
    </>
  )
}

export default myaccordion

有人能告诉我一个替代如何使用 accordion Bootstrap 。

rlcwz9us

rlcwz9us1#

正确的:

import Accordion from 'react-bootstrap/Accordion';

错误:

import { Accordion } from 'react-bootstrap/Accordion';

相关问题