ReactJS预期<li>的相应JSX结束标记

时间:2016-11-04 15:28:40

标签: reactjs jsx

我没有做出反应就把这个错误抛给了我:Expected corresponding JSX closing tag for <li>因为一切都很好,只有当我有多个li元素时

 render() {
        return (
          <nav className="navbar navbar-inverse navbar-fixed-top" id="sidebar-wrapper" role="navigation">
            <ul className="nav sidebar-nav">
              <li>
                  <a href="#" className="active">
                    <i className="fa fa-home"></i>Home
                  </a>
              </li>
              <li>
                <a className="collapsible-header waves-effect arrow-r">
                  <i className="fa fa-user"></i> About me<i className="fa fa-angle-down rotate-icon"></i>
                </a>
              <li>
            </ul>
          </nav>     
        );
      }

有人可以帮我解决这个问题吗?

1 个答案:

答案 0 :(得分:3)

您在第二次结束li时缺少斜杠:

  <li>
    <a className="collapsible-header waves-effect arrow-r">
      <i className="fa fa-user"></i> About me<i className="fa fa-angle-down rotate-icon"></i>
    </a>
  </li>