Closed bjosttveit closed 1 week ago
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
getHostSibling
HostText
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.
kind/*
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
Description
React's
getHostSibling
function can be very slow for renderless components, this will make sure it finds the sibling immediately by adding aHostText
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-L226Edit: 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
kind/*
label to this PR for proper release notes grouping