Skip to content

Commit

Permalink
allow users to opt out of deprecation warnings by setting flags to fa…
Browse files Browse the repository at this point in the history
…lse (#12441)

* allow users to opt out of deprecation warnings by setting flags to false

* Create slow-birds-fetch.md
  • Loading branch information
brookslybrand authored Dec 4, 2024
1 parent 09ff7a0 commit 9b6f889
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
5 changes: 5 additions & 0 deletions .changeset/slow-birds-fetch.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"react-router": patch
---

Allow users to opt out of deprecation warnings by setting flags to false
12 changes: 6 additions & 6 deletions packages/react-router/lib/deprecations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export function logV6DeprecationWarnings(
renderFuture: Partial<RenderFutureConfig> | undefined,
routerFuture?: Omit<RouterFutureConfig, "v7_prependBasename">
) {
if (!renderFuture?.v7_startTransition) {
if (renderFuture?.v7_startTransition === undefined) {
logDeprecation(
"v7_startTransition",
"React Router will begin wrapping state updates in `React.startTransition` in v7",
Expand All @@ -31,7 +31,7 @@ export function logV6DeprecationWarnings(
}

if (
!renderFuture?.v7_relativeSplatPath &&
renderFuture?.v7_relativeSplatPath === undefined &&
(!routerFuture || !routerFuture.v7_relativeSplatPath)
) {
logDeprecation(
Expand All @@ -42,31 +42,31 @@ export function logV6DeprecationWarnings(
}

if (routerFuture) {
if (!routerFuture.v7_fetcherPersist) {
if (routerFuture.v7_fetcherPersist === undefined) {
logDeprecation(
"v7_fetcherPersist",
"The persistence behavior of fetchers is changing in v7",
"https://reactrouter.com/v6/upgrading/future#v7_fetcherpersist"
);
}

if (!routerFuture.v7_normalizeFormMethod) {
if (routerFuture.v7_normalizeFormMethod === undefined) {
logDeprecation(
"v7_normalizeFormMethod",
"Casing of `formMethod` fields is being normalized to uppercase in v7",
"https://reactrouter.com/v6/upgrading/future#v7_normalizeformmethod"
);
}

if (!routerFuture.v7_partialHydration) {
if (routerFuture.v7_partialHydration === undefined) {
logDeprecation(
"v7_partialHydration",
"`RouterProvider` hydration behavior is changing in v7",
"https://reactrouter.com/v6/upgrading/future#v7_partialhydration"
);
}

if (!routerFuture.v7_skipActionErrorRevalidation) {
if (routerFuture.v7_skipActionErrorRevalidation === undefined) {
logDeprecation(
"v7_skipActionErrorRevalidation",
"The revalidation behavior after 4xx/5xx `action` responses is changing in v7",
Expand Down

0 comments on commit 9b6f889

Please sign in to comment.