msyavuz commented on code in PR #32729:
URL: https://github.com/apache/superset/pull/32729#discussion_r2005208062


##########
superset-frontend/src/components/Form/Form.tsx:
##########
@@ -16,21 +16,19 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-// eslint-disable-next-line no-restricted-imports
-import AntdForm, { FormProps } from 'antd/lib/form'; // TODO: Remove antd
-import { styled } from '@superset-ui/core';
+import { Form as AntdForm } from 'antd-v5';
+import { FormProps, FormInstance, FormItemProps } from 'antd-v5/es/form';
 
-const StyledForm = styled(AntdForm)`
-  &.ant-form label {
-    font-size: ${({ theme }) => theme.fontSizeSM}px;
-  }
-  .ant-form-item {
-    margin-bottom: ${({ theme }) => theme.sizeUnit * 4}px;
-  }
-`;
-
-export default function Form(props: FormProps) {
-  return <StyledForm {...props} />;
+function Form(props: FormProps) {
+  return <AntdForm {...props} />;
 }
 
-export type { FormProps };
+export default Object.assign(Form, {
+  useForm: AntdForm.useForm,
+  Item: AntdForm.Item,
+  List: AntdForm.List,
+  ErrorList: AntdForm.ErrorList,
+  Provider: AntdForm.Provider,
+});
+

Review Comment:
   There are some type issues in usages with using that syntax. I think being a 
bit more explicit might be okay here? What do you think



##########
superset-frontend/src/components/Form/Form.tsx:
##########
@@ -16,21 +16,19 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-// eslint-disable-next-line no-restricted-imports
-import AntdForm, { FormProps } from 'antd/lib/form'; // TODO: Remove antd
-import { styled } from '@superset-ui/core';
+import { Form as AntdForm } from 'antd-v5';
+import { FormProps, FormInstance, FormItemProps } from 'antd-v5/es/form';
 
-const StyledForm = styled(AntdForm)`
-  &.ant-form label {
-    font-size: ${({ theme }) => theme.fontSizeSM}px;
-  }
-  .ant-form-item {
-    margin-bottom: ${({ theme }) => theme.sizeUnit * 4}px;
-  }
-`;
-
-export default function Form(props: FormProps) {
-  return <StyledForm {...props} />;
+function Form(props: FormProps) {
+  return <AntdForm {...props} />;
 }
 
-export type { FormProps };
+export default Object.assign(Form, {
+  useForm: AntdForm.useForm,
+  Item: AntdForm.Item,
+  List: AntdForm.List,
+  ErrorList: AntdForm.ErrorList,
+  Provider: AntdForm.Provider,
+});
+

Review Comment:
   There are some type issues in usages with using that syntax. I think being a 
bit more explicit might be okay here? What do you think?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to