PHP前端开发

React 基础知识~映射函数/数据列表~

百变鹏仔 4天前 #JavaScript
文章标签 基础知识

・src/example.js

const animals = ["dog", "cat", "rat"];const example = () => {  return (          
> );};export default example;

・src/example.js

const animals = ["Dog", "Cat", "Rat"];const Example = () => {  return (          
> );};export default Example;

・这是控制台的警告,以防我们没有将 key 属性放在

  • 元素上。

    ・这是屏幕上的结果。