Comments (6)
I solved this problem deleting node_modules, package-lock.json and doing again npm install
from react.
suggestion from the NextJS team:
You can use // @ts-ignore as a temporary solution to avoid type errors.
source: https://nextjs.org/docs/app/api-reference/functions/generate-metadata#link-reldns-prefetch
from react.
I can second to the error you've received , prefetchDNS is indeed not found in 'react-dom'
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.
@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.
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.
Yes, the functionality exists, but it has not been documented with types yet.
from react.
Related Issues (20)
- Bug: validateDOMNesting(...): <tr> cannot appear as a child of <table>. - but it seems to be not correct according to the specification HOT 6
- Bug: `onMouseLeave` events don't seem to behave correctly HOT 3
- Bug: `useOptimistic` reducer is called twice (not in strict-mode) HOT 1
- [DevTools Bug]: Hide logs during second render in Strict Mode not working HOT 8
- react router dom HOT 2
- How to build React Canary from source HOT 2
- Bug: possible bug in createPortal - invalid hook calls in micro frontends setup HOT 1
- Bug: how to contribute to open source HOT 1
- Bug: react-server-dom-webpack gets confused by package.json#exports map and crashes HOT 2
- how to use <Profiler> to get dom performance data with headless browser? HOT 1
- Bug: Why did react use「Window.event」 to implement the event lane which has been declared abandoned by MDN?
- Bug: Suspense fallback is not interactive
- I have the same Problem (macOS Sonoma 14.1.1) while executing `sudo gem install cocoapods` and I get the following error message:
- Bug: The development build file is missing React.__ SECRET_ INTERNALS_ DO_ NOT_ USE_ OR_ YOU_ Will_ BE_ FIRED.Scheduler HOT 2
- Bug: createPortal does not add anything to the DOM HOT 7
- Bug: States not mainted in the page HOT 1
- [DevTools Bug]: hook parsing fails while using functional component + redux or alternative HOT 1
- EqualityFn for useEffect, useMemo, useCallback HOT 3
- Doc's: missing information about using useCallback for Custom Hooks HOT 1
- Missing Information about useCallback in Custom Hooks Documentation HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react.