@douyinfe/semi-ui
Version:
A modern, comprehensive, flexible design system and UI library. Connect DesignOps & DevOps. Quickly build beautiful React apps. Maintained by Douyin-fe team.
13 lines • 470 B
JavaScript
import React, { forwardRef } from 'react';
import { FormApiContext } from '../context';
function withFormApi(Component) {
let WithApiCom = (props, ref) => {
return /*#__PURE__*/React.createElement(FormApiContext.Consumer, null, formApi => (/*#__PURE__*/React.createElement(Component, Object.assign({
formApi: formApi,
ref: ref
}, props))));
};
WithApiCom = /*#__PURE__*/forwardRef(WithApiCom);
return WithApiCom;
}
export default withFormApi;