Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 2 years ago.
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(1)
您的代码中有多个警告/错误需要修复才能编译。将来,请考虑在将代码推送到 GitHub 或 Netlify 等代码服务器之前,在本地计算机上编译开发版本。 阅读错误消息也会有所帮助。
还请将错误消息括在代码块中,并在以下情况下插入换行符:必要的。这将使其他人更容易阅读您的错误消息。
TailwindCSS 警告 (1)
当您使用 TailwindCSS v3 时,请将
purge
属性更改为content
。文档
TailwindCSS 警告 (2)
从 TailwindCSS v3 开始,
darkMode
设置为false
与设置为media
相同。将其完全删除,因为不再需要它。仅当您需要将其设置为class
时才使用它。文档
React ESLint 错误 (3)
看起来像 <您的代码中的 code>useEffect() 缺少依赖项:
navigate
。根据代码的工作方式,您需要删除整个依赖项数组或向其中添加navigate
依赖项。删除整个依赖项数组:
添加
navigate
依赖项:的情况也是如此
fetchPinDetails
中 >src/components/PinDetails.jsx 第 64:6 行activeBtn
在src/components/UserProfile.jsx
第 53:6 行userInfo?.googleId
insrc/container/Home.jsx
line 33:6HTML/React ESLint 警告 (4)
在较旧的浏览器中,如果您有一个打开的链接不包含
rel="noreferrer"
的新选项卡(又名target="_blank"
)存在安全风险。添加它以删除警告。如果您熟悉的话,它还意味着noopener
,因此您不需要添加它。ESLint 警告 (5-6)
您定义了变量,但从未在任何地方使用过它。删除它们,除非您需要使用它们。
src/components/PinDetails.jsx
第 10:10 行中的MdMaximize
src/components/PinDetails.jsx
中的addingComment
line 16:10以后请在访问 Stack Overflow 之前阅读错误消息。如果您阅读并参考其链接的文档页面,所有这些错误或警告都可以轻松解决。
You have multiple warnings/errors in your code that needs to be fixed in order to compile. In the future, please consider compiling a development build on your local machine before pushing your code to a code server like GitHub or Netlify. Reading the error message will also help.
Please also enclose the error message in code blocks and insert newlines when necessary. This will make it much easier for others to read your error message.
TailwindCSS Warning (1)
Change the
purge
property tocontent
as you're using TailwindCSS v3.Docs
TailwindCSS Warning (2)
As of TailwindCSS v3,
darkMode
being set tofalse
is the same as if it is set tomedia
. Remove it entirely as it isn't needed anymore. Only use it when you need it to be set toclass
.Docs
React ESLint Error (3)
It seems like a
useEffect()
in your code is missing a dependency:navigate
. Depending on how your code works, you will need to either remove the entire dependency array or add thenavigate
dependency to it.Removing the entire dependency array:
Adding the
navigate
dependency:This is also the case with:
fetchPinDetails
insrc/components/PinDetails.jsx
line 64:6activeBtn
insrc/components/UserProfile.jsx
line 53:6userInfo?.googleId
insrc/container/Home.jsx
line 33:6HTML/React ESLint Warning (4)
In older browsers, if you have a link that opens on a new tab (a.k.a.
target="_blank"
), not includingrel="noreferrer"
is a security risk. Add it to remove the warning. It also impliesnoopener
if you're familiar with that, so you don't need to add it.ESLint Warning (5-6)
You have variables that are defined but it was never used anywhere. Remove those unless you need to use them.
MdMaximize
insrc/components/PinDetails.jsx
line 10:10addingComment
insrc/components/PinDetails.jsx
line 16:10In the future please read error messages before coming to Stack Overflow. All of these errors or warnings can be easily resolved if you read them and refer to their linked documentation pages.