Skip to content

Commit 03becf6

Browse files
committed
Remove null in useRedirect type
1 parent 847f751 commit 03becf6

2 files changed

Lines changed: 9 additions & 9 deletions

File tree

packages/ra-core/src/routing/useRedirect.spec.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,15 @@ import { Identifier, RaRecord } from '../types';
1313
const Redirect = ({
1414
redirectTo,
1515
resource = '',
16-
id = null,
17-
data = null,
18-
state = null,
16+
id = undefined,
17+
data = undefined,
18+
state = undefined,
1919
}: {
2020
redirectTo: RedirectionSideEffect;
2121
resource?: string;
22-
id?: Identifier | null;
23-
data?: Partial<RaRecord> | null;
24-
state?: object | null;
22+
id?: Identifier;
23+
data?: Partial<RaRecord>;
24+
state?: object;
2525
}) => {
2626
const redirect = useRedirect();
2727
useEffect(() => {

packages/ra-core/src/routing/useRedirect.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,9 @@ export const useRedirect = () => {
4141
(
4242
redirectTo: RedirectionSideEffect,
4343
resource: string = '',
44-
id?: Identifier | null,
45-
data?: Partial<RaRecord> | null,
46-
state: object | null = {}
44+
id?: Identifier,
45+
data?: Partial<RaRecord>,
46+
state: object = {}
4747
) => {
4848
if (!redirectTo) {
4949
return;

0 commit comments

Comments
 (0)