import React from 'react';
import { InputNumber } from 'antd';
function InputNumberSuffix(props) {
const { suffix } = props;
if (suffix) {
return (
<span className="input-number-suffix ant-input-affix-wrapper">
<InputNumber {...props} />
<span className="ant-input-suffix">{suffix}</span>
</span>
);
}
return (
<InputNumber {...props} />
);
}
export default InputNumberSuffix;
import React from 'react';
import { InputNumber } from 'antd';
const InputNumberSuffix = React.forwardRef((props, ref) => {
const { forwardedRef, suffix, ...rest } = props;
if (suffix) {
return (
<span className="input-number-suffix ant-input-affix-wrapper">
<InputNumber ref={ref} {...rest} />
<span className="ant-input-suffix">{suffix}</span>
</span>
);
}
return (
<InputNumber ref={ref} {...rest} />
);
});
export default InputNumberSuffix;