在React组件中使用img标记时出现__reactInternalInstance问题

时间:2017-05-19 01:46:19

标签: image reactjs components react-jsx jsx

我正在尝试在我的React组件中显示图像。以下是我的代码:

    import React from 'react';

const Header = () => {
  const posterIMG = "https://cdn-images-1.medium.com/max/800/1*AfzFa8zO_dQOmuSHL7bEww.png";
  return(
    <div className="top_nav">
      <div className="nav_menu">
        <nav>
          <ul className="nav navbar-nav navbar-right">
            <li className="">
              <a href="javascript:void(0);" className="user-profile dropdown-toggle" data-toggle="dropdown" aria-expanded="false">
                <img id="postertest" src={"/public/images/img.jpg"}  className="img" alt="Profile Image"/>
                <span className=" fa fa-angle-down"/>
              </a>
            </li>
          </ul>
        </nav>
      </div>
      <div className="poster-container nopadding col-xs-12 col-md-4 pull-md-8 col-lg-5 pull-lg-7 ">
        <img id="postertest" className='poster' src={posterIMG}/>
      </div>
    </div>
  );
};

export default Header;

代码显示图像,但同时抛出控制台错误。当我删除图像标记时,控制台中没有错误。

enter image description here

有人可以帮我解决这里发生的事情吗?

0 个答案:

没有答案