ui5-webcomponents-react icon indicating copy to clipboard operation
ui5-webcomponents-react copied to clipboard

[DynamicPageTitle]: React elements from actions prop re-render on browser resize

Open stanleychh opened this issue 5 months ago • 0 comments

Describe the bug

Issue: When resizing the browser window, all React elements passed through the actions prop are being re-rendered unexpectedly. This behavior is causing performance issues or unintended side effects during resizing.

<DynamicPageTitle 
   actions=[<Component1>, <Component2>, <Component3> ]
    ....
/>

Isolated Example

https://stackblitz.com/edit/github-edkpyt?file=src%2FApp.tsx

Reproduction steps

  1. Create a DynamicPage component with a DynamicPageTitle sub component
  2. Pass a stateless component to actions prop, also add log when component got rendered
  3. Resizing the browser and observe the logging.

Expected Behaviour

If the component itself doesn't change, there is no need to re-render. This cause performance issue when there are a lot of React elements pass as the prop

Screenshots or Videos

No response

UI5 Web Components for React Version

1.29.9

UI5 Web Components Version

1.24.8

Browser

Chrome, Edge, Firefox, Safari

Operating System

MAC

Additional Context

No response

Relevant log output

No response

Organization

SAP Signavio

Declaration

  • [X] I’m not disclosing any internal or sensitive information.

stanleychh avatar Sep 06 '24 17:09 stanleychh