File tree Expand file tree Collapse file tree 1 file changed +5
-8
lines changed
packages/ra-core/codemods Expand file tree Collapse file tree 1 file changed +5
-8
lines changed Original file line number Diff line number Diff line change @@ -82,7 +82,8 @@ const replaceDatagrid = (root, j) => {
8282
8383 const openingElement = j . jsxOpeningElement (
8484 j . jsxIdentifier ( 'DataTable' ) ,
85- attributes
85+ attributes ,
86+ false
8687 ) ;
8788 const closingElement = j . jsxClosingElement (
8889 j . jsxIdentifier ( 'DataTable' )
@@ -116,24 +117,20 @@ const cleanAttributes = (node, j) => {
116117 ) {
117118 const expression = attr . value . expression ;
118119 if ( j . ObjectExpression . check ( expression ) ) {
119- const properties = expression . properties . map ( prop => {
120+ expression . properties . map ( prop => {
120121 if (
121122 j . ObjectProperty . check ( prop ) &&
122123 j . Literal . check ( prop . key ) &&
123124 typeof prop . key . value === 'string'
124125 ) {
125- const newKey = prop . key . value . replace (
126+ prop . key . value = prop . key . value . replace (
126127 / R a D a t a g r i d - / g,
127128 'RaDataTable-'
128129 ) ;
129- return j . objectProperty ( j . literal ( newKey ) , prop . value ) ;
130130 }
131131 return prop ;
132132 } ) ;
133- return j . jsxAttribute (
134- j . jsxIdentifier ( 'sx' ) ,
135- j . jsxExpressionContainer ( j . objectExpression ( properties ) )
136- ) ;
133+ return attr ;
137134 }
138135 }
139136 return attr ;
You can’t perform that action at this time.
0 commit comments