简体   繁体   English

React Bootstrap导航栏不起作用

[英]React bootstrap Nav bar not working

I already did npm install on react-bootstrap and do 我已经把npm安装在react-bootstrap上并做了

import { Nav, Navbar, NavItem, MenuItem, NavDropdown } from 'react-bootstrap'; 从'react-bootstrap'导入{Nav,Navbar,NavItem,MenuItem,NavDropdown};

at the beginning, but I got this error Module build failed: SyntaxError: Unexpected token, expected , with inverse which is in < Navbar inverse collapseOnSelect > 一开始,但是我遇到了这个错误模块构建失败:SyntaxError:意外的令牌,预期,与<Navbar inverse crashOnSelect>中的相反

Here's my code for render method in react component enter image description here 这是我的反应组件中渲染方法的代码在这里输入图像描述

I think you have to pass the property "inverse" into a props : 我认为您必须将属性“ inverse”传递给props:

<Navbar bsStyle="inverse" collapseOnSelect>

You can check the available props there : https://react-bootstrap.github.io/components.html#navigation 您可以在那里查看可用的道具: https : //react-bootstrap.github.io/components.html#navigation

Hope it helps :) 希望能帮助到你 :)

Dylan 迪伦

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM