Skip to content

Commit ab9c8d0

Browse files
committed
Apply preset-19 codemod
```bash $ npx types-react-codemod.cjs preset-19 . Processing 230 files... Results: 0 errors 227 unmodified 0 skipped 3 ok ```
1 parent ec55192 commit ab9c8d0

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

examples/auth/src/App.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ import {
1010
} from "react-router-dom";
1111
import { fakeAuthProvider } from "./auth";
1212

13+
import type { JSX } from "react";
14+
1315
export default function App() {
1416
return (
1517
<AuthProvider>

packages/react-router-dom/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -759,7 +759,7 @@ export function BrowserRouter({
759759
future,
760760
window,
761761
}: BrowserRouterProps) {
762-
let historyRef = React.useRef<BrowserHistory>();
762+
let historyRef = React.useRef<BrowserHistory>(undefined);
763763
if (historyRef.current == null) {
764764
historyRef.current = createBrowserHistory({ window, v5Compat: true });
765765
}
@@ -810,7 +810,7 @@ export function HashRouter({
810810
future,
811811
window,
812812
}: HashRouterProps) {
813-
let historyRef = React.useRef<HashHistory>();
813+
let historyRef = React.useRef<HashHistory>(undefined);
814814
if (historyRef.current == null) {
815815
historyRef.current = createHashHistory({ window, v5Compat: true });
816816
}

packages/react-router/lib/components.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ export function MemoryRouter({
222222
initialIndex,
223223
future,
224224
}: MemoryRouterProps): React.ReactElement {
225-
let historyRef = React.useRef<MemoryHistory>();
225+
let historyRef = React.useRef<MemoryHistory>(undefined);
226226
if (historyRef.current == null) {
227227
historyRef.current = createMemoryHistory({
228228
initialEntries,

0 commit comments

Comments
 (0)