Skip to content

Commit 5df9956

Browse files
committed
fix wrong quote -> from ' to "
1 parent 6ac08a2 commit 5df9956

File tree

1 file changed

+3
-10
lines changed

1 file changed

+3
-10
lines changed

packages/ra-core/codemods/replace-Datagrid-DataTable.ts

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -214,22 +214,15 @@ const transformChild = (root, j, child) => {
214214
};
215215

216216
const wrapChild = (j, child) => {
217-
const childSource = child.openingElement.attributes.find(
217+
const sourceAttribute = child.openingElement.attributes.find(
218218
attr => j.JSXAttribute.check(attr) && attr.name.name === 'source'
219-
)?.value?.value;
219+
);
220220

221221
// Wrap the child in a DataTable.Col component
222222
return j.jsxElement(
223223
j.jsxOpeningElement(
224224
j.jsxIdentifier('DataTable.Col'),
225-
!childSource
226-
? []
227-
: [
228-
j.jsxAttribute(
229-
j.jsxIdentifier('source'),
230-
j.stringLiteral(childSource)
231-
),
232-
],
225+
!sourceAttribute ? [] : [sourceAttribute],
233226
false
234227
),
235228
j.jsxClosingElement(j.jsxIdentifier('DataTable.Col')),

0 commit comments

Comments
 (0)