NEXTJS_USE_NATIVE_FETCH
Conformance is available on Enterprise plans
Next.js extends the native Web API with additional caching capabilities which means third-party fetch libraries are not needed. Including these libraries in your app can increase bundle size and negatively impact performance.
This rule will detect any usage of the following third-party fetch libraries:
If there are more libraries you would like to restrict, consider using a custom rule.
By default, this rule is disabled. You can enable it by customizing Conformance.
For further reading, see:
- https://nextjs.org/docs/app/api-reference/functions/fetch
- https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API
This rule will catch the following code.
Replace the third-party fetch library with the native API Next.js provides.
Was this helpful?