Click here to Skip to main content
15,741,818 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: undefined. You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.

Check the render method of `CustomNavbar`.

what is the cause of this error i tried to solve it but its not ending

What I have tried:

import React, { Component } from 'react';
import { Navbar, Nav, NavItem } from 'react-bootstrap';
import { Link } from 'react-router-dom';

export default class CustomNavbar extends Component {
	render() {
		return (
		    <Navbar default collapseOnSelect>
                <Navbar.Header>
                    <Navbar.Brand>
                        <Link to="/">Simpleweb</Link>
                    </Navbar.Brand>
                    <Navbar.Toggle />
                </Navbar.Header>
                <Navbar.collapse>
                	<Nav pullRight>
                	    <NavItem eventkey={1} componentClass={Link} to="/">
                	       Home
                        </NavItem>
                        <NavItem eventkey={2} componentClass={Link} to="/about">
                	       About
                        </NavItem>
                        <NavItem eventkey={3} componentClass={Link} to="/news">
                	       News
                        </NavItem>
                	</Nav>
                </Navbar.collapse>
			</Navbar>			
		);
	}
}
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900