File tree Expand file tree Collapse file tree 2 files changed +14
-4
lines changed
Expand file tree Collapse file tree 2 files changed +14
-4
lines changed Original file line number Diff line number Diff line change @@ -240,8 +240,18 @@ export const ObjectMap: React.FC<ObjectMapProps> = ({
240240 setLoading ( true ) ;
241241
242242 // Prioritize data passed via props (from ListView)
243- if ( ( schema as any ) . data || ( rest as any ) . data ) {
244- const passed = ( schema as any ) . data || ( rest as any ) . data ;
243+ if ( ( rest as any ) . data ) { // Check props.data directly first
244+ const passed = ( rest as any ) . data ;
245+ if ( Array . isArray ( passed ) ) {
246+ setData ( passed ) ;
247+ setLoading ( false ) ;
248+ return ;
249+ }
250+ }
251+
252+ // Check schema.data next
253+ if ( ( schema as any ) . data ) {
254+ const passed = ( schema as any ) . data ;
245255 if ( Array . isArray ( passed ) ) {
246256 setData ( passed ) ;
247257 setLoading ( false ) ;
Original file line number Diff line number Diff line change @@ -16,9 +16,9 @@ export { ObjectMap };
1616export type { ObjectMapProps } ;
1717
1818// Register component
19- export const ObjectMapRenderer : React . FC < { schema : any } > = ( { schema } ) => {
19+ export const ObjectMapRenderer : React . FC < any > = ( { schema, ... props } ) => {
2020 const { dataSource } = useSchemaContext ( ) ;
21- return < ObjectMap schema = { schema } dataSource = { dataSource } /> ;
21+ return < ObjectMap schema = { schema } dataSource = { dataSource } { ... props } /> ;
2222} ;
2323
2424console . log ( 'Registering object-map...' ) ;
You can’t perform that action at this time.
0 commit comments