reactjs - Typescript React React.createElement: type should not be null, undefined, boolean, or number -
i using typescript(1.8.10) , learning react. using react-bootstrap build simple navigation example , getting following error. error prevents dom getting rendered. totally new react not sure doing wrong here. thank or pointers past error.
// '.tsx' file enables jsx support in typescript compiler, // more information see following page on typescript wiki: // https://github.com/microsoft/typescript/wiki/jsx /// <reference path="./../../../typings/index.d.ts" /> import * react 'react'; import * reactbootstrap 'react-bootstrap'; interface inavigationprops { } let navbar = reactbootstrap.navbar; let navitem = reactbootstrap.navitem; let menuitem = reactbootstrap.menuitem; let navbarheader = reactbootstrap.navbarheader; const dropdownitems = [ { href: '#', name: 'overview' }, { href: '#', name: 'setup' }, { href: '#', name: 'usage' }, ]; export default class navigation extends react.component<inavigationprops, {}> { render() { return ( <navbar> <navbarheader href="homepage.html" name="website name"/> <navitem> <menuitem link="about.html" title="about" /> <menuitem link="contact.html" title="contact" /> <menuitem link="services.html" title="services" /> </navitem> </navbar> ); } } // '.tsx' file enables jsx support in typescript compiler, // more information see following page on typescript wiki: // https://github.com/microsoft/typescript/wiki/jsx /// <reference path="./../../typings/index.d.ts" /> import * react "react"; import * reactdom "react-dom"; import * reactbootstrap 'react-bootstrap'; import headernavigation "./navigationcomponent/navigation"; import hello "./hellocomponent/hello"; reactdom.render( <div> <headernavigation /> <hello name="athraya" /> </div>, document.getelementbyid("root") );
is react version compatible react-bootstrap version, or bootstrap nav facilities? according this, maybe versions cause error.
or did check react-router, because using link property.did check this?
Comments
Post a Comment