GithubHelp home page GithubHelp logo

Comments (6)

ssaurexd avatar ssaurexd commented on May 1, 2024 1

I solved this problem deleting node_modules, package-lock.json and doing again npm install

from react.

jadurani avatar jadurani commented on May 1, 2024 1

suggestion from the NextJS team:

You can use // @ts-ignore as a temporary solution to avoid type errors.

image

source: https://nextjs.org/docs/app/api-reference/functions/generate-metadata#link-reldns-prefetch

from react.

Gauravpadam avatar Gauravpadam commented on May 1, 2024

I can second to the error you've received , prefetchDNS is indeed not found in 'react-dom'

image

Closest I've ever come across is ReactDOM.prefetch(url)

However I'm not getting the same dns-prefetch tag when using prefetchDNS()

import React from "react";
import ReactDOM from "react-dom";

export function PreloadResources() {
  ReactDOM.prefetchDNS("https://www.google.com/");

  return null;
}


function App() {
  return (
    <>
      <PreloadResources />
    </>
  );
}

export default App;

It's a small component, similar to yours
maybe its the code that is incorrect?
other devs can take a look

from react.

hmartiins avatar hmartiins commented on May 1, 2024

@Gauravpadam the difference I saw is that I call my component within the head tag of my site, in your code you are calling it in the body of the page, and it would be cool to see if the react-dom is up to date, as these functions are still very recent

from react.

hmartiins avatar hmartiins commented on May 1, 2024

From what I've seen the types are even implemented in the ReactDOMTypes. But it is not up to date with the @types/react-dom type library, we can check it in this link.

I can contribute by updating the type library, but I don't know if it's the right way to go..

from react.

hmartiins avatar hmartiins commented on May 1, 2024

Yes, the functionality exists, but it has not been documented with types yet.

from react.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.