@hzab/form-render 1.7.6 → 1.7.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ # @hzab/form-render@1.7.7
2
+
3
+ feat: scenario form-render
4
+
1
5
  # @hzab/form-render@1.7.6
2
6
 
3
7
  fix: ts 报错修复
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hzab/form-render",
3
- "version": "1.7.6",
3
+ "version": "1.7.7",
4
4
  "description": "",
5
5
  "main": "src",
6
6
  "scripts": {
package/src/index.tsx CHANGED
@@ -70,15 +70,11 @@ const antdComponents = {
70
70
 
71
71
  const FormRender = forwardRef((props: any, parentRef) => {
72
72
  /** schema scope 解决父级无 schema Scope 导致 scope 对象刷新的问题 */
73
- const schemaScopeRef = useRef<{ _$tempData: Object }>();
74
- if (props.schemaScope && !schemaScopeRef.current) {
75
- schemaScopeRef.current = props.schemaScope;
76
- } else if (!schemaScopeRef.current) {
77
- schemaScopeRef.current = { _$tempData: {} };
78
- }
79
- if (!schemaScopeRef.current?._$tempData) {
80
- schemaScopeRef.current._$tempData = {};
81
- }
73
+ const schemaScopeRef = useRef<{ _$tempData: Object }>({
74
+ scenario: "form-render",
75
+ _$tempData: {},
76
+ ...props.schemaScope,
77
+ });
82
78
  const SchemaField = useCallback(
83
79
  createSchemaField({
84
80
  components: {