报错
Unhandled Runtime Error
Error: React.Children.only expected to receive a single React element child.
发现是这样的
<div className={`cont float_right`}> <Link href={`/product/details/[productId]`} as={`/product/details/${item.product_id}`}> <CommentRegularIcon className={`CommentRegularIcon`}/> {item.review_cnt} </Link> </div>
Link 里面不能2个分的标签换成这样就行了
<div className={`cont float_right`}> <Link href={`/product/details/[productId]`} as={`/product/details/${item.product_id}`}> <span><CommentRegularIcon className={`CommentRegularIcon`}/>{item.review_cnt}</span> </Link> </div>
<Link href={`/product/[categoryId]`} as={`/product/${this.state.data.category_id}`}><span>{this.state.data.category_name}</span></Link>
这样也行 Link 里面不能直接包含文字,要加个单独的标签