Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(react): handle fetchpriority vs fetchPriority #644

Merged
merged 1 commit into from
Apr 28, 2024
Merged

Conversation

ascorbic
Copy link
Owner

@ascorbic ascorbic commented Apr 28, 2024

When facebook/react#25927 was merged it meant that React would accept fetchPriority as a prop. Unfortunately it then wouldn't accept fetchpriority anymore. This would lead to scary error messages in dev or SSR. In Next.js there's no way to know which version you're using, because Next.js reports both versions as 18.x, even when actually using the bundled experimental version that includes this change. The upshot is that in Next.js, pages router needs fetchpriority and app router needs fetchPriority. The best way to detect which one you're using is to look for the existence of use(). React I love you but you're bringing me down.

Fixes #425

Copy link

netlify bot commented Apr 28, 2024

Deploy Preview for unpic-next ready!

Name Link
🔨 Latest commit 52214c7
🔍 Latest deploy log https://app.netlify.com/sites/unpic-next/deploys/662e2a7552a756000828c7bb
😎 Deploy Preview https://deploy-preview-644--unpic-next.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

netlify bot commented Apr 28, 2024

Deploy Preview for unpic-docs ready!

Name Link
🔨 Latest commit 52214c7
🔍 Latest deploy log https://app.netlify.com/sites/unpic-docs/deploys/662e2a755310f70008b73f73
😎 Deploy Preview https://deploy-preview-644.preview.unpic.pics
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 99 (no change from production)
Accessibility: 100 (no change from production)
Best Practices: 92 (no change from production)
SEO: 100 (no change from production)
PWA: -
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

netlify bot commented Apr 28, 2024

Deploy Preview for unpic-angular ready!

Name Link
🔨 Latest commit 52214c7
🔍 Latest deploy log https://app.netlify.com/sites/unpic-angular/deploys/662e2a75d9377400081635cf
😎 Deploy Preview https://deploy-preview-644--unpic-angular.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@ascorbic ascorbic changed the title fix: handle fetchpriority vs fetchPriority fix(react): handle fetchpriority vs fetchPriority Apr 28, 2024
@ascorbic ascorbic enabled auto-merge (squash) April 28, 2024 10:53
@ascorbic ascorbic merged commit 6b76808 into main Apr 28, 2024
22 of 25 checks passed
@ascorbic ascorbic deleted the fetchpriority branch April 28, 2024 10:55
@mixie-bot mixie-bot bot mentioned this pull request Apr 28, 2024
kodiakhq bot pushed a commit that referenced this pull request Apr 28, 2024
🤖 I have created a release *beep* *boop*
---


<details><summary>react: 0.1.14</summary>

## [0.1.14](react-v0.1.13...react-v0.1.14) (2024-04-28)


### Bug Fixes

* **react:** handle fetchpriority vs fetchPriority ([#644](#644)) ([6b76808](6b76808))
* **react:** support Next.js server component ([#646](#646)) ([a2e58ea](a2e58ea))
</details>

---
This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Warning: React does not recognize the fetchPriority prop on a DOM element
1 participant