Remove forceRerender
from Tab
component
#1846
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This was necessary to ensure the
Panel
and theTab
were properlyconnected with eachother because it could happen that the
Tab
rendersbut the corresponding
Panel
is not the active one which means that itdidn't have a DOM node and no
id
attached.Whenever new
Tab
became active, it rerendered but thePanel
wasn'tavailable yet, after that the
Panel
rendered and anid
was availablebut the actual
Tab
was already rendered so there was no link betweenthem.
We then forced a re-render because now the
Panel
does have a DOM noderef attached and the
aria-labelledby
could be filled in.However, in #1837 we fixed an issue where the order of
Tab
elementswith their corresponding
Panel
elements weren't always correct. To fixthis we ensured that the
Panel
always rendered a<Hidden />
component which means that a DOM node is always available.
This now means that we can get rid of the
forceRerender
.