File tree Expand file tree Collapse file tree 1 file changed +34
-0
lines changed
packages/ra-core/src/controller/edit Expand file tree Collapse file tree 1 file changed +34
-0
lines changed Original file line number Diff line number Diff line change @@ -75,6 +75,40 @@ export const EncodedIdWithPercentage = ({
7575 ) ;
7676} ;
7777
78+ export const WarningLogWithDifferentMeta = ( ) => (
79+ < TestMemoryRouter initialEntries = { [ '/posts/5' ] } >
80+ < CoreAdminContext
81+ dataProvider = { testDataProvider ( {
82+ getOne : ( _resource , { id } ) =>
83+ Promise . resolve ( {
84+ data : { id, title : 'hello' } as any ,
85+ } ) ,
86+ } ) }
87+ >
88+ < Routes >
89+ < Route
90+ path = "/posts/:id"
91+ element = {
92+ < EditController
93+ resource = "posts"
94+ queryOptions = { { meta : { foo : 'bar' } } }
95+ redirect = { false }
96+ >
97+ { ( { record } ) => (
98+ < >
99+ < LocationInspector />
100+ < p > Id: { record && record . id } </ p >
101+ < p > Title: { record && record . title } </ p >
102+ </ >
103+ ) }
104+ </ EditController >
105+ }
106+ />
107+ </ Routes >
108+ </ CoreAdminContext >
109+ </ TestMemoryRouter >
110+ ) ;
111+
78112const LocationInspector = ( ) => {
79113 const location = useLocation ( ) ;
80114 return (
You can’t perform that action at this time.
0 commit comments