Next.js Discord

Discord Forum

hydration error (yay)

Answered
Arinji posted this in #help-forum
Open in Discord
uh so it says there isnt a matching p... but like the component which is causing the error dosent have a p.....
Answered by Arinji
<div> cannot appear as a descendant of <p>.

So used span
View full answer

49 Replies

woah wtf is .mkv
lemme make normal wait
mp4, enjoy :D
im new to obs lmao
Mrigal carp
@Arinji
thas clean af, show settings lol
wait #off-topic
lets keep this clean for when ray fixes all my issues
Mrigal carp
okay
BLIMP :D
@Arinji Click to see attachment
:>
@Arinji Click to see attachment
do you still see hydration error if you comment out ParagraphComponent
Sorry for the music btw.. I'm trying out different screen recorders lol
ok @Ray
removing the paragraph component also works
could you show the code?
@Ray could you show the code?
which ones?
paragraphcomponent
oki
export function ParagraphComponent({ ...props }) {
  if (typeof props.children === "string") {
    if (props.children.startsWith("||")) {
      return (
        <div className="w-full font-bold h-fit pt-[14px] pr-[10px] pb-[15px] pl-[22px] border-l-[5px] border-[#FBE900] bg-[#b5ac48] rounded-[5px] ">
          <p className=" md:text-[14px] text-[10px]">
            {props.children.replace("||", "").trim()}
          </p>
        </div>
      );
    }
  }

  if (Array.isArray(props.children) && props.children.length >= 2) {
    if (typeof props.children[0] === "string") {
      if (
        typeof props.children[1] === "object" &&
        props.children[1].props &&
        props.children[1].props.href
      ) {
        const youtubeHref = props.children[1].props.href;

        return (
          <div className="w-full xl:h-[500px] h-[200px]">
            <iframe
              width="100%"
              height="100%"
              src={`https://www.youtube.com/embed/${youtubeHref}?si=XVfG_6H3a3FUAgX2`}
              title="YouTube video player"
              allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"
              allowFullScreen
            ></iframe>
          </div>
        );
      }
    }
  }

  return (
    <p className=" md:text-[14px] text-[10px] text-shades-white">
      {props.children}
    </p>
  );
}
oki
no work
Expected server HTML to contain a matching <div> in <p>.
@Ray try comment out the iframe
cant we just suppress hydration errors from the markdown part
try comment out these line
return (
        <div className="w-full font-bold h-fit pt-[14px] pr-[10px] pb-[15px] pl-[22px] border-l-[5px] border-[#FBE900] bg-[#b5ac48] rounded-[5px] ">
          <p className=" md:text-[14px] text-[10px]">
            {props.children.replace("||", "").trim()}
          </p>
        </div>
      );
oki
@Ray yeah you could lol
how do i do it tho
how about comment out these too
return (
          <div className="w-full xl:h-[500px] h-[200px]">
            <iframe
              width="100%"
              height="100%"
              src={`https://www.youtube.com/embed/${youtubeHref}?si=XVfG_6H3a3FUAgX2`}
              title="YouTube video player"
              allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"
              allowFullScreen
            ></iframe>
          </div>
        );
export function ParagraphComponent({ ...props }) {
  console.log(props);
  /* if (typeof props.children === "string") {
    if (props.children.startsWith("||")) {
      return (
        <div className="w-full font-bold h-fit pt-[14px] pr-[10px] pb-[15px] pl-[22px] border-l-[5px] border-[#FBE900] bg-[#b5ac48] rounded-[5px] ">
          <p className=" md:text-[14px] text-[10px]">
            {props.children.replace("||", "").trim()}
          </p>
        </div>
      );
    }
  }
  */

  /*if (Array.isArray(props.children) && props.children.length >= 2) {
    if (typeof props.children[0] === "string") {
      if (
        typeof props.children[1] === "object" &&
        props.children[1].props &&
        props.children[1].props.href
      ) {
        const youtubeHref = props.children[1].props.href;

        return (
          <div className="w-full xl:h-[500px] h-[200px]">
            <iframe
              width="100%"
              height="100%"
              src={`https://www.youtube.com/embed/${youtubeHref}?si=XVfG_6H3a3FUAgX2`}
              title="YouTube video player"
              allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"
              allowFullScreen
            ></iframe>
          </div>
        );
      }
    }
  }
  */

  return (
    <p className=" md:text-[14px] text-[10px] text-shades-white">
      {props.children}
    </p>
  );
}
@Arinji i have everything commented
how about changing this
<div>
<p className=" md:text-[14px] text-[10px] text-shades-white">
      {props.children}
    </p>
</div>
oki
still broken, just noticed this btw
Component Stack
div
p
div
li
ul
div
div
main
want me to track it?
where is ul li?
uh here
wait this is the markdown btw
A custom domain allows you to have a professional looking domain such as **example.net** or **play.example.net**.

- Go to your [NameCheap dashboard](https://ap.www.namecheap.com/).
- Select your domain and click **Manage**.
  ![](https://storage.crisp.chat/users/helpdesk/website/edd4387938180800/image_15o3twu.png)
- Click **Advanced DNS**.
  ![](https://storage.crisp.chat/users/helpdesk/website/edd4387938180800/image_sa5jum.png)

**With a dedicated IP:**
If you have a [dedicated IP](/en/article/what-are-dedicated-ips-pex5da/), you are not required to make a SRV record, as you have Minecraft Java's default port.

- Press **Add New Record**, then select **A Record**.
  ![](https://storage.crisp.chat/users/helpdesk/website/edd4387938180800/image_c8266r.png)
- In the Host box, type **@** if you want it to be just your domain, or you can put play/mc if you wish for that to be the domain prefix (play.revivenode.com/mc.revivenode.com).
- In the IP Address box, type your Minecraft server's IP (without the port).
  ![](https://storage.crisp.chat/users/helpdesk/website/edd4387938180800/image_1ulpqs4.png)
- Finally press the green tick.

- If you put a **@** in the **A** record, you should use the first one, if you used play/mc/anything else, you need to use the second one.

|| This can take up to 2 hours to update and start working!

${youtube}[](YB-oyfnryTk)
so the - make lists
liveshare?
sure,
<div> cannot appear as a descendant of <p>.

So used span
Answer
@Ray u fine with me marking this the ans?
yeah