4、问题描述:React Hooks 开发时,启动总是提示hooks 语法错误?
原因:react声明组件时,第一个字母必须大写。
5、问题描述:React 开发菜单目录树结构时,数据结构如何定义?...id: '1'
},{ name: 'zding',
id: '2'
},{ name: '3',
id: '3'
}
]
当数组中为单类型数据时:...string、int等类型,这种方式的修改就不起作用了
let arr = [1,3,5,7,9]
arr.forEach(function(item){
item = 30
})
console.log...(arr) //输出 [1, 3, 5, 7, 9]
期望输输出 [30, 30, 30, 30, 30],但实际上输出为 [1, 3, 5, 7, 9],修改没有起作用。