Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/google-chrome/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Google chrome 反应警告没有出现_Google Chrome_Reactjs_React Dom - Fatal编程技术网

Google chrome 反应警告没有出现

Google chrome 反应警告没有出现,google-chrome,reactjs,react-dom,Google Chrome,Reactjs,React Dom,我试着重述一些基础知识。我写了一个小例子,希望有一个警告,不要将一个键作为map函数的每个元素的参数传递 JS: HTML: 但它不会显示(我使用的是Chrome btw)。请确保您使用的是非精简版(开发版)的Rect。由于性能原因,React会在缩小的生产版本中删除警告和错误。这解决了一切。谢谢没问题!!!!!!!! var ing = [ "1 cucumber", "2 tomatoes", "1/2 onion", "2 olive oil spoon

我试着重述一些基础知识。我写了一个小例子,希望有一个警告,不要将一个键作为map函数的每个元素的参数传递

JS:

HTML:



但它不会显示(我使用的是Chrome btw)。

请确保您使用的是非精简版(开发版)的Rect。由于性能原因,React会在缩小的生产版本中删除警告和错误。这解决了一切。谢谢没问题!!!!!!!!
var ing = [
    "1 cucumber",
    "2 tomatoes",
    "1/2 onion",
    "2 olive oil spoon"
];

var Div = React.createElement(
  "ul",
  null,
  ing.map( function(ing){ return  React.createElement("li", null, ing)})
);

ReactDOM.render(Div, document.getElementById("react-app"));
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <script src="https://cdnjs.cloudflare.com/ajax/libs/react/15.5.4/react.min.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/react/15.5.4/react-dom.min.js"></script>
</head>
<body>
    <div id="react-app"></div>
    <script src="./app.js"></script>
</body>
</html>