You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kie.apache.org by ti...@apache.org on 2023/09/25 16:31:05 UTC

[incubator-kie-kogito-apps] branch main updated: kie-issues#525: Fix wrong usage of useCallback to useMemo (#1878)

This is an automated email from the ASF dual-hosted git repository.

tiagobento pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-kie-kogito-apps.git


The following commit(s) were added to refs/heads/main by this push:
     new a9f5d1cb4 kie-issues#525: Fix wrong usage of useCallback to useMemo (#1878)
a9f5d1cb4 is described below

commit a9f5d1cb4bb0759ef63facd2b81c8c79da373a18
Author: Jozef Marko <Jo...@ibm.com>
AuthorDate: Mon Sep 25 18:31:00 2023 +0200

    kie-issues#525: Fix wrong usage of useCallback to useMemo (#1878)
    
    This is a followup PR for https://github.com/kiegroup/kogito-apps/pull/1875
    This worng code was spotted after merge of original PR so opening this fix as a separate PR.
---
 .../src/envelope/components/FormDisplayer/FormDisplayer.tsx         | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/ui-packages/packages/form-displayer/src/envelope/components/FormDisplayer/FormDisplayer.tsx b/ui-packages/packages/form-displayer/src/envelope/components/FormDisplayer/FormDisplayer.tsx
index 58e40c247..efd51ccb0 100644
--- a/ui-packages/packages/form-displayer/src/envelope/components/FormDisplayer/FormDisplayer.tsx
+++ b/ui-packages/packages/form-displayer/src/envelope/components/FormDisplayer/FormDisplayer.tsx
@@ -15,9 +15,9 @@
  */
 
 import React, {
-  useCallback,
   useEffect,
   useImperativeHandle,
+  useMemo,
   useState
 } from 'react';
 import { Bullseye } from '@patternfly/react-core/dist/js/layouts/Bullseye';
@@ -73,7 +73,7 @@ export const FormDisplayer = React.forwardRef<
       return api;
     };
 
-    const canDisplayForm = useCallback(() => {
+    const canDisplayForm = useMemo(() => {
       return isEnvelopeConnectedToChannel && !isExecuting && source;
     }, [isEnvelopeConnectedToChannel, isExecuting, source]);
 
@@ -114,7 +114,7 @@ export const FormDisplayer = React.forwardRef<
 
     return (
       <div {...componentOuiaProps(ouiaId, 'form-displayer', ouiaSafe)}>
-        {canDisplayForm() ? (
+        {canDisplayForm ? (
           <div id={'inner-form-container'}>
             {content.formInfo && content.formInfo.type === 'TSX' ? (
               <ReactFormRenderer


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org