English 中文(简体)
ReactJS Error: Response/jsx-no-undef byactive cell
原标题:ReactJS Error: react/jsx-no-undef by react-bootstrap

我想在我的项目中使用菜单。 首先,我从React-posts Screen选择,但方案显示的是反应/jsx-no-undef。

这是从React-posts Screen网站。

const navbarInstance = (
<Navbar>
    <Navbar.Header>
      <Navbar.Brand>
        <a href="#">React-Bootstrap</a>
      </Navbar.Brand>
    </Navbar.Header>
    <Nav>
      <NavItem eventKey={1} href="#">Link</NavItem>
      <NavItem eventKey={2} href="#">Link</NavItem>
      <NavDropdown eventKey={3} title="Dropdown" id="basic-nav-dropdown">
        <MenuItem eventKey={3.1}>Action</MenuItem>
        <MenuItem eventKey={3.2}>Another action</MenuItem>
        <MenuItem eventKey={3.3}>Something else here</MenuItem>
        <MenuItem divider />
        <MenuItem eventKey={3.4}>Separated link</MenuItem>
      </NavDropdown>
    </Nav>
  </Navbar>
);
ReactDOM.render(navbarInstance, mountNode);
问题回答

对我来说,我的工作是:

Import ReactBoostrap and all their components using Destructuring:

import ReactBootstrap, {Jumbotron, Button, Col, Grid, Panel, FormGroup} from  react-bootstrap 

使用:

class HelloWorld extends Component {

    render() {
        return (
            <div className="container">
            <Jumbotron>
                <p>Bootstrap is workings? </p>
                <div className="my-class-from-react">
                    <h1>Hello World from React.js</h1>
                </div>
            </Jumbotron>
            </div>
        )
    }
}

export default HelloWorld;




相关问题
selected text in iframe

How to get a selected text inside a iframe. I my page i m having a iframe which is editable true. So how can i get the selected text in that iframe.

How to fire event handlers on the link using javascript

I would like to click a link in my page using javascript. I would like to Fire event handlers on the link without navigating. How can this be done? This has to work both in firefox and Internet ...

How to Add script codes before the </body> tag ASP.NET

Heres the problem, In Masterpage, the google analytics code were pasted before the end of body tag. In ASPX page, I need to generate a script (google addItem tracker) using codebehind ClientScript ...

Clipboard access using Javascript - sans Flash?

Is there a reliable way to access the client machine s clipboard using Javascript? I continue to run into permissions issues when attempting to do this. How does Google Docs do this? Do they use ...

javascript debugging question

I have a large javascript which I didn t write but I need to use it and I m slowely going trough it trying to figure out what does it do and how, I m using alert to print out what it does but now I ...

Parsing date like twitter

I ve made a little forum and I want parse the date on newest posts like twitter, you know "posted 40 minutes ago ","posted 1 hour ago"... What s the best way ? Thanx.

热门标签