You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@inlong.apache.org by he...@apache.org on 2022/09/20 03:39:54 UTC
[inlong] branch master updated: [INLONG-5938][Dashboard] The parameter of calling to get the topic is lost (#5939)
This is an automated email from the ASF dual-hosted git repository.
healchow pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/inlong.git
The following commit(s) were added to refs/heads/master by this push:
new d8d756188 [INLONG-5938][Dashboard] The parameter of calling to get the topic is lost (#5939)
d8d756188 is described below
commit d8d756188cdf2657a06ba68d87dba6de72074806
Author: Daniel <le...@apache.org>
AuthorDate: Tue Sep 20 11:39:47 2022 +0800
[INLONG-5938][Dashboard] The parameter of calling to get the topic is lost (#5939)
---
inlong-dashboard/src/components/FormGenerator/FormGenerator.tsx | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/inlong-dashboard/src/components/FormGenerator/FormGenerator.tsx b/inlong-dashboard/src/components/FormGenerator/FormGenerator.tsx
index 5d9971e9c..cf17c0b8f 100644
--- a/inlong-dashboard/src/components/FormGenerator/FormGenerator.tsx
+++ b/inlong-dashboard/src/components/FormGenerator/FormGenerator.tsx
@@ -17,7 +17,7 @@
* under the License.
*/
-import React, { useState, useEffect, useMemo } from 'react';
+import React, { useState, useEffect, useMemo, useCallback } from 'react';
import { Form } from 'antd';
import type { FormProps } from 'antd';
import merge from 'lodash/merge';
@@ -74,7 +74,7 @@ const FormGenerator: React.FC<FormGeneratorProps> = props => {
const viewOnly = props.viewOnly ?? false;
- const combineContentWithProps = usePersistFn(
+ const combineContentWithProps = useCallback(
(initialContent: Record<string, any>[], props: FormGeneratorProps) => {
return initialContent.map((v: any) => {
const initialProps =
@@ -133,6 +133,7 @@ const FormGenerator: React.FC<FormGeneratorProps> = props => {
};
});
},
+ [realTimeValues, form, viewOnly],
);
// A real-time value is generated when it is first mounted, because the initialValue may be defined on the FormItem