traccar / traccar-web

Traccar GPS Tracking System
https://www.traccar.org
Apache License 2.0
814 stars 1.12k forks source link

Fix/prevent re-render reports menu #1252

Open jorgeart81 opened 3 months ago

jorgeart81 commented 3 months ago

Create a ReportLayout so that the ReportsMenu is not affected by the status update. Ref -> PR/1251

Video

https://github.com/traccar/traccar-web/assets/92123185/60e22d0d-b604-4668-bf6e-e74f90b3b709

tananaev commented 3 months ago

Can you please clarify how this fixes the problem.

jorgeart81 commented 3 months ago

Response to comment https://github.com/traccar/traccar-web/pull/1252#issuecomment-2197794442

Child components are affected by the rendering of the parent or container component. In this case, when converting<PageLayout menu={<ReportsMenu />} Breadcrumbs={['reportTitle', 'reportCombined']}> to the parent container, the change of state of the children only affects their content, therefore the component main (Layout) is not affected.