File tree 1 file changed +11
-7
lines changed
packages/ra-core/src/sideEffect
1 file changed +11
-7
lines changed Original file line number Diff line number Diff line change @@ -35,18 +35,22 @@ const useNotify = () => {
35
35
autoHideDuration ?: number ,
36
36
multiLine ?: boolean
37
37
) => {
38
- if ( typeof type === 'string' ) {
38
+ if ( typeof type === 'string' || ! type ) {
39
39
warning (
40
40
true ,
41
41
'This way of calling useNotify callback is deprecated. Please use the new syntax passing notify("[Your message]", { ...restOfArguments })'
42
42
) ;
43
43
dispatch (
44
- showNotification ( message , type || 'info' , {
45
- messageArgs,
46
- undoable,
47
- autoHideDuration,
48
- multiLine,
49
- } )
44
+ showNotification (
45
+ message ,
46
+ ( type || 'info' ) as NotificationType ,
47
+ {
48
+ messageArgs,
49
+ undoable,
50
+ autoHideDuration,
51
+ multiLine,
52
+ }
53
+ )
50
54
) ;
51
55
} else {
52
56
const { type : messageType , ...options } = type ;
You can’t perform that action at this time.
0 commit comments