#Hydration failed

3 messages · Page 1 of 1 (latest)

slim gull
#

Error: Hydration failed because the initial UI does not match what was rendered on the server.
Warning: Expected server HTML to contain a matching <a> in <option>.

How can i fix this problem. I couldn't fix

import Link from "next/link";

const SortProducts = (props) => {
  return (
    <div>
      <select>
        <option value="suggested">
          <Link href="/" prefetch={false}>
            Suggested order
          </Link>
        </option>
        <option value="suggested">
          <Link href="/?s=asc" prefetch={false}>
            Ascending by id
          </Link>
        </option>
        <option value="suggested">
          <Link href="/?s=desc" prefetch={false}>
            Descending by id
          </Link>
        </option>
      </select>
    </div>
  );
};
export default SortProducts;
main oarBOT
#

🔎 This post has been indexed in our web forum and will be seen by search engines so other users can find it outside Discord

      🕵️ Your user profile is private by default and won't be visible to users outside Discord, if you want to be visible in the web forum you can add the "Public Profile" role in <id:customize>

      ✅ You can mark a message as the answer for your post with `Right click -> Apps -> Mark Solution`
      (if you don't see the option, try refreshing Discord with Ctrl + R)
left ravine
#

you can't have an a tag inside an option tag, its not semantically correct and will throw an hydration error