next.js 19:259错误:''可以用'','','','''‘'’. react/no-未转义实体转义

wpx232ag  于 2023-03-02  发布在  React
关注(0)|答案(2)|浏览(89)

我尝试使用vercel将我的项目部署到云中,但中途显示了一条错误消息:19:259错误:可以使用'‘'’'进行转义。
关于. jsx代码:

import React from 'react';
import Image from 'next/image';
import AboutImg from '../public/assets/about.png';

const About = () => {
  return (
    <div id='about' className='w-full md:h-screen p-2 flex items-center py-16'>
      <div className='max-w-[1240px] m-auto md:grid grid-cols-3 gap-8'>
        <div className='col-span-2'>
          <p className='uppercase text-xl tracking-widest text-[#5651e5]'>
            About Me
          </p>
          <h2 className='py-4'>Who I Am?</h2>
          <p className='py-2 text-gray-600'>
            / / I am not your average developer
          </p>
          <p className='py-2 text-gray-600'>
            test
          </p>

          
          
          <a href='/../public/assets/about.png'>
            <p className='py-2 text-gray-600 underline cursor-pointer'>
              Download file
            </p>
          </a>
        </div>
        <div className='w-full h-auto m-auto shadow-xl shadow-gray-400 rounded-xl flex items-center justify-center p-4 hover:scale-105 ease-in duration-300'>
          <Image src={AboutImg} className='rounded-xl' alt='/' />
        </div>
      </div>
    </div>
  );
};

export default About;

skills.jsx:

import Image from 'next/image';
import React from 'react';
import { AiFillHtml5 } from "react-icons/Ai";
import { DiCss3 } from "react-icons/Di";
import { DiPython } from "react-icons/Di";
import { AiFillGithub } from "react-icons/Ai";
import { TbBrandNextjs } from "react-icons/Tb";
import { DiDjango } from "react-icons/Di";
import { SiTailwindcss } from "react-icons/Si";
import { FaDocker } from "react-icons/Fa";

const Skills = () => {
  return (
    <div id='skills' className='w-full lg:h-screen p-2'>
      <div className='max-w-[1240px] mx-auto flex flex-col justify-center h-full'>
        <p className='text-xl tracking-widest uppercase text-[#5651e5]'>
          My Skills
        </p>
        <h2 className='py-4'>What I Can Do?</h2>
        
        <div className='grid grid-cols-2 lg:grid-cols-4 gap-8'>
        <div className='p-6 shadow-xl rounded-xl hover:scale-10 ease-in duration-300'>
            <div className='grid grid-cols-2 justify-center items-center'>
            <AiFillHtml5 className="w-10 h-10 bg-blue-400 text-gray-100 m-3 p-1 shadow-xl rounded-md" />
              <div>
                <h3>HTML</h3>
              </div>
            </div>
          </div>

          <div className='p-6 shadow-xl rounded-xl hover:scale-10 ease-in duration-300'>
            <div className='grid grid-cols-2 justify-center items-center'>
            <DiCss3 className="w-10 h-10 bg-blue-400 text-gray-100 m-3 p-1 shadow-xl rounded-md" />
              <div>
                <h3>CSS</h3>
              </div>
            </div>
          </div>

          <div className='p-6 shadow-xl rounded-xl hover:scale-10 ease-in duration-300'>
            <div className='grid grid-cols-2 justify-center items-center'>
            <DiPython className="w-10 h-10 bg-blue-400 text-gray-100 m-3 p-1 shadow-xl rounded-md" />
              <div>
                <h3>Python</h3>
              </div>
            </div>
          </div>

          <div className='p-6 shadow-xl rounded-xl hover:scale-10 ease-in duration-300'>
            <div className='grid grid-cols-2 justify-center items-center'>
            <DiDjango className="w-10 h-10 bg-blue-400 text-gray-100 m-3 p-1 shadow-xl rounded-md" />
              <div>
                <h3>Django</h3>
              </div>
            </div>
          </div>

          
          
          <div className='p-6 shadow-xl rounded-xl hover:scale-10 ease-in duration-300'>
            <div className='grid grid-cols-2 justify-center items-center'>
            <SiTailwindcss className="w-10 h-10 bg-blue-400 text-gray-100 m-3 p-1 shadow-xl rounded-md" />
              <div>
                <h3>Tailwind CSS</h3>
              </div>
            </div>
          </div>

          <div className='p-6 shadow-xl rounded-xl hover:scale-10 ease-in duration-300'>
            <div className='grid grid-cols-2 justify-center items-center'>
            <FaDocker className="w-10 h-10 bg-blue-400 text-gray-100 m-3 p-1 shadow-xl rounded-md" />
              <div>
                <h3>Docker</h3>
              </div>
            </div>
          </div>

          <div className='p-6 shadow-xl rounded-xl hover:scale-10 ease-in duration-300'>
            <div className='grid grid-cols-2 justify-center items-center'>
            <AiFillGithub className="w-10 h-10 bg-blue-400 text-gray-100 m-3 p-1 shadow-xl rounded-md" />
              <div>
                <h3>Github</h3>
              </div>
            </div>
          </div>

          <div className='p-6 shadow-xl rounded-xl hover:scale-10 ease-in duration-300'>
            <div className='grid grid-cols-2 justify-center items-center'>
            <TbBrandNextjs className="w-10 h-10 bg-blue-400 text-gray-100 m-3 p-1 shadow-xl rounded-md" />
              <div>
                <h3>NextJs</h3>
              </div>
            </div>
          </div>

        </div>
      </div>
    </div>
  );
};

export default Skills;

这个错误是什么意思,我如何解决这个问题?我在本地主机上运行时没有问题,只是部署有这个错误问题。

jc3wubiy

jc3wubiy1#

我得到了同样的错误,它指向我的代码,在那里我添加了一个简单的文本,如下所示

<p>dont't have a account?</p>

我设法通过将文本放入模板常量中来修复它

<p>{`dont't have a account?`}</p>

你也可以这样做

<p>{`dont&apos;t have a account?`}</p>
c2e8gylq

c2e8gylq2#

我也有同样的问题

<p>Enter leader's name</p>

尝试

<p>{`Enter leader's name`}</p>

相关问题