我只是尝试加载react-bootstrap组件,而且似乎没有加载。我觉得我缺少明显的东西。我已经安装了react-bootstrap和bootstrap。我正在尝试包装并将其导出到App.js
分别是我的Navbar组件和App.js:
import { Navbar } from 'react-bootstrap';
import { Component } from 'react';
class NavigationBar extends Component{
render(){
return(
<Navbar>
hello
</Navbar>
)
}
}
export default NavigationBar;
import React from 'react';
import NavigationBar from './components/NavigationBar.js'
import { Navbar } from 'react-bootstrap'
function App() {
return (
<div className="App">
<header className="App-header">
<NavigationBar></NavigationBar>
</header>
</div>
);
}
export default App;
答案 0 :(得分:0)
更改此行=>从“反应”中导入React,{组件};
import React, { Component } from 'react';
import { Navbar } from 'react-bootstrap';
class NavigationBar extends Component{
render(){
return(
<Navbar>
home
</Navbar >
)
}
}
export default NavigationBar;