fix: remove ref

This commit is contained in:
jackycheng
2024-11-06 15:14:57 +08:00
parent 86fab50b14
commit f15dff2c42

View File

@@ -1,4 +1,4 @@
import React, { useImperativeHandle } from 'react';
import React from 'react';
import { RenderFieldPropsType } from '{{ UIPackageName }}';
import './index.css';
@@ -12,26 +12,12 @@ type {{ ComponentName }}Props = {
};
/**
* ref对象定义
* {{ DisplayName }}
*/
type {{ ComponentName }}Ref = {
};
/**
* 组件定义
*/
const {{ ComponentName }} = React.forwardRef<{{ ComponentName }}Ref, {{ ComponentName }}Props>((props, ref) => {
const {{ ComponentName }} = (props: {{ ComponentName }}Props) => {
const { value, defaultValue } = props;
useImperativeHandle(ref, () => {
return {
/* 请填写ref方法 */
};
});
return <>{JSON.stringify(value || defaultValue || '')}</>;
});
};
{{ ComponentName }}.displayName = '{{ ComponentName }}';
export const renderFieldProps: RenderFieldPropsType = {