@@ -134,24 +134,24 @@ const DemoRender = (): JSX.Element => {
134
134
newProps.control = React.createElement(MaterialUI.Radio);
135
135
}
136
136
137
- if (type === 'TableBody') {
138
- console.log('Processing TableBody with rows:', rows);
139
- children = rows.map(row => {
140
- console.log('Processing row:', row);
141
- return {
142
- type: 'TableRow',
143
- props: { key: row.name },
144
- children: [
145
- { type: 'TableCell', props: { component: 'th', scope: 'row' }, children: row.name },
146
- { type: 'TableCell', props: { align: 'right' }, children: String(row.calories) },
147
- { type: 'TableCell', props: { align: 'right' }, children: String(row.fat) },
148
- { type: 'TableCell', props: { align: 'right' }, children: String(row.carbs) },
149
- { type: 'TableCell', props: { align: 'right' }, children: String(row.protein) },
150
- ]
151
- };
152
- });
153
- }
154
- console.log('post tableBody check', children);
137
+ // if (type === 'TableBody') {
138
+ // console.log('Processing TableBody with rows:', rows);
139
+ // children = rows.map(row => {
140
+ // console.log('Processing row:', row);
141
+ // return {
142
+ // type: 'TableRow',
143
+ // props: { key: row.name },
144
+ // children: [
145
+ // { type: 'TableCell', props: { component: 'th', scope: 'row' }, children: row.name },
146
+ // { type: 'TableCell', props: { align: 'right' }, children: String(row.calories) },
147
+ // { type: 'TableCell', props: { align: 'right' }, children: String(row.fat) },
148
+ // { type: 'TableCell', props: { align: 'right' }, children: String(row.carbs) },
149
+ // { type: 'TableCell', props: { align: 'right' }, children: String(row.protein) },
150
+ // ]
151
+ // };
152
+ // });
153
+ // }
154
+ // console.log('post tableBody check', children);
155
155
156
156
const processChildren = (child) => {
157
157
if (typeof child === 'string') {
@@ -180,6 +180,12 @@ const DemoRender = (): JSX.Element => {
180
180
if(segment.trim().startsWith('{') && segment.trim().endsWith('}')) {
181
181
try {
182
182
const jsonData = JSON.parse(segment);
183
+ // console.log('jsonData', jsonData);
184
+ if (jsonData.props && jsonData.props.children) {
185
+ jsonData.children = jsonData.children || [];
186
+ // console.log('jsonData.props.children', jsonData.props.children);
187
+ jsonData.children = [...jsonData.children, ...jsonData.props.children];
188
+ }
183
189
const componentContainer = document.createElement('div');
184
190
container.appendChild(componentContainer);
185
191
const component = createComponentFromData(jsonData);
0 commit comments