Skip to content

Commit 3fd082a

Browse files
brophdawg11rakleed
andauthored
Suppress v7 warnings in production build (#12794)
* Suppress v7 warnings in production build (#12509) * Don't log v7 deprecation warnings in prod builds --------- Co-authored-by: Pavel <[email protected]>
1 parent 8006afe commit 3fd082a

File tree

3 files changed

+9
-1
lines changed

3 files changed

+9
-1
lines changed

.changeset/big-lamps-remain.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
"react-router-dom": patch
3+
"react-router": patch
4+
"@remix-run/router": patch
5+
---
6+
7+
Do not log v7 deprecation warnings in production builds

contributors.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,7 @@
215215
- petersendidit
216216
- promet99
217217
- pyitphyoaung
218+
- rakleed
218219
- refusado
219220
- rimian
220221
- robbtraister

packages/react-router/lib/deprecations.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import type { FutureConfig as RenderFutureConfig } from "./components";
44
const alreadyWarned: { [key: string]: boolean } = {};
55

66
export function warnOnce(key: string, message: string): void {
7-
if (!alreadyWarned[message]) {
7+
if (__DEV__ && !alreadyWarned[message]) {
88
alreadyWarned[message] = true;
99
console.warn(message);
1010
}

0 commit comments

Comments
 (0)