gpt4 book ai didi

reactjs - React : is using incorrect casing中的控制台错误

转载 作者:行者123 更新时间:2023-12-03 08:33:00 24 4
gpt4 key购买 nike

将多个dom元素包装在react片段中,以使单个render语句可以全部返回它们。返回错误:

Warning: <reactFragment /> is using incorrect casing. 
Use PascalCase for React components, or lowercase for HTML elements.
和错误
Warning: The tag <reactFragment> is unrecognized in this browser. 
If you meant to render a React component, start its name with an uppercase letter.

最佳答案

采用

import React, { Fragment } from "react";

并将 <reactFragment />替换为 <Fragment />。那应该清理您的代码并帮助解决问题。

关于reactjs - React : <reactFragment/> is using incorrect casing中的控制台错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/65078905/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com