升级后,我会在控制台上收到此错误消息

时间:2018-09-23 21:03:01

标签: reactjs

-这是我在运行“ npm start”之后得到的错误

元素类型无效:需要一个字符串(对于内置组件)或一个类/函数(对于复合组件)

screenhoot from the browser notification

它说index.js有问题

import React from 'react';
import ReactDOM from 'react-dom';
import './index.css';
import App from './App';
import registerServiceWorker from './registerServiceWorker';


ReactDOM.render(<App />, document.getElementById('root'));
registerServiceWorker();

这是Header组件

import React from 'react';

import classes from './Header.css';
import { Button } from 'react-bootstrap';
import DeelnemerOverlay from '../../assets/images/deelnemer- 
 overlay.jpg';
import CoachOverlay from '../../assets/images/coachOverlay.jpg';

const header = (props) => (
<div className={classes.Image}>

<div className={classes.Deelnemer}>

<h2>Informatie voor Deelnemers</h2>
  <br />
  <img alt='deelnemer' src={DeelnemerOverlay}></img>
  <br />
  <br />
<p>
  <Button bsStyle="primary">Meer over deelnemers</Button>
</p>
</div>
<div className={classes.Coach}>
<h2>Informatie voor Coachen</h2>
 <br />
 <img alt='coach' src={CoachOverlay}></img>
 <br />
 <br />

 <p><Button bsStyle="primary">Meer over coachen</Button></p>
 <br />
 </div>
 </div>
 );

 export default header;

有人可以帮我吗?

1 个答案:

答案 0 :(得分:0)

已解决。在Header组件中,我的引导程序无法正常工作。我解决了将我的引导程序从4降级到3的低谷