const CommentList = ({ comments }) => { 函数把comments前后大括号去掉有问题

来源:4-2 留言本实例编码

weixin_慕前端9168190

2021-07-30 19:17

在CommentList .js文件中, 把

const CommentList = ({ comments }) => {  

函数comments前后大括号去掉有问题,编译出来说 comments.map 并不是个函数


写回答 关注

1回答

  • 夜袭开发站
    2021-08-02 14:52:17

    是个析构写法,相当于 comments = props.comments;

基于实例的 React16 傻瓜课程

通过一系列简单有趣的例子,让你了解 React16 的基本概念和新特性

22327 学习 · 103 问题

查看课程

相似问题