feature/IO-3499-React-19: Remove redundant forward refs in favor of React 19 built in ref prop
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
import { InputNumber } from "antd";
|
||||
import { forwardRef } from "react";
|
||||
|
||||
// const locale = "en-us";
|
||||
// const currencyFormatter = (value) => {
|
||||
@@ -41,7 +40,7 @@ import { forwardRef } from "react";
|
||||
// }
|
||||
// };
|
||||
|
||||
function FormItemCurrency(props, ref) {
|
||||
function FormItemCurrency({ ref, ...props }) {
|
||||
return (
|
||||
<InputNumber
|
||||
{...props}
|
||||
@@ -54,4 +53,4 @@ function FormItemCurrency(props, ref) {
|
||||
);
|
||||
}
|
||||
|
||||
export default forwardRef(FormItemCurrency);
|
||||
export default FormItemCurrency;
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
import { MailFilled } from "@ant-design/icons";
|
||||
import { Button, Input, Space } from "antd";
|
||||
import { forwardRef } from "react";
|
||||
|
||||
function FormItemEmail(props, ref) {
|
||||
const { defaultValue, value, ...restProps } = props;
|
||||
function FormItemEmail({ defaultValue, value, ref, ...restProps }) {
|
||||
const emailValue = defaultValue || value;
|
||||
|
||||
return (
|
||||
@@ -18,4 +16,4 @@ function FormItemEmail(props, ref) {
|
||||
);
|
||||
}
|
||||
|
||||
export default forwardRef(FormItemEmail);
|
||||
export default FormItemEmail;
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import { forwardRef } from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
|
||||
const LaborTypeFormItem = ({ value }) => {
|
||||
@@ -8,4 +7,4 @@ const LaborTypeFormItem = ({ value }) => {
|
||||
|
||||
return <div>{t(`joblines.fields.lbr_types.${value}`)}</div>;
|
||||
};
|
||||
export default forwardRef(LaborTypeFormItem);
|
||||
export default LaborTypeFormItem;
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import { forwardRef } from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
|
||||
const PartTypeFormItem = ({ value }) => {
|
||||
@@ -10,4 +9,4 @@ const PartTypeFormItem = ({ value }) => {
|
||||
<div style={{ wordWrap: "break-word", overflowWrap: "break-word" }}>{t(`joblines.fields.part_types.${value}`)}</div>
|
||||
);
|
||||
};
|
||||
export default forwardRef(PartTypeFormItem);
|
||||
export default PartTypeFormItem;
|
||||
|
||||
@@ -1,14 +1,13 @@
|
||||
import { Input } from "antd";
|
||||
import i18n from "i18next";
|
||||
import parsePhoneNumber from "libphonenumber-js";
|
||||
import { forwardRef } from "react";
|
||||
import "./phone-form-item.styles.scss";
|
||||
|
||||
function FormItemPhone(props, ref) {
|
||||
function FormItemPhone({ ref, ...props }) {
|
||||
return <Input ref={ref} {...props} />;
|
||||
}
|
||||
|
||||
export default forwardRef(FormItemPhone);
|
||||
export default FormItemPhone;
|
||||
|
||||
export const PhoneItemFormatterValidation = () => ({
|
||||
async validator(rule, value) {
|
||||
|
||||
Reference in New Issue
Block a user