我正在使用Next.js和Bootstrap创建一个React应用 但是当我尝试导入Bootstrap.js时出现错误
我尝试在Bootstrap.js之前导入Jquery,但这不起作用,这是我的Header组件代码
import React from 'react';
import Head from 'next/head';
import '../static/style.css';
import 'bootstrap/dist/css/bootstrap.min.css';
import 'bootstrap/dist/js/bootstrap.bundle.min.js'
const Header = (props) => (
<div>
<Head>
<meta charSet="UTF-8"/>
<title></title>
<meta name="" content=""/>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<meta property="og:url" content=""/>
<meta property="og:title" content=""/>
</Head>
<div className="container">
<nav className="navbar navbar-expand-lg navbar-light">
<a className="navbar-brand" href="#">LOGO</a>
<button className="navbar-toggler" type="button" data-toggle="collapse"
data-target="#navbarSupportedContent"
aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span className="navbar-toggler-icon"></span>
</button>
<div className="collapse navbar-collapse" id="navbarSupportedContent">
<ul className="navbar-nav ml-auto">
<li className="nav-item dropdown">
<MenuItem category="products" img="menu1.jpg" text="Products & Solutions" content={
<>
<a className="dropdown-item" href="#">Action</a>
<a className="dropdown-item" href="#">Another action</a>
<div className="dropdown-divider"></div>
<a className="dropdown-item" href="#">Something else here</a>
</>
}>
</MenuItem>
</li>