Altinn / app-frontend-react

Altinn application React frontend
BSD 3-Clause "New" or "Revised" License
18 stars 31 forks source link

Performance: Speed up `getHostSibling` for repeating group row generation #2709

Closed bjosttveit closed 1 week ago

bjosttveit commented 1 week ago

Description

React's getHostSibling function can be very slow for renderless components, this will make sure it finds the sibling immediately by adding a HostText fiber-node directly below. The space will be added to the DOM, but should not be visible. See https://github.com/facebook/react/blob/ed15d5007ca7ee4d61294c741ce3e858d3c1d461/packages/react-reconciler/src/ReactFiberCommitHostEffects.js#L222-L226

Edit: Turns out the space will be added to the DOM, but they are at least not visible. I could not find a better or less hacky method of solving this issue.

Related Issue(s)

Verification/QA

sonarcloud[bot] commented 1 week ago

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
100.0% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarCloud