Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
fix(AbstractNav): allow passed in refs to be properly forwarded #4031
So I'm not exactly sure why this test is failing. The ref functionality shouldn't change anything about the assertion being made on Line 220, yet it's still failing.
What's interesting is that if I change this line to:
EDIT: It seems to be testing an implementation detail, which is causing the false negatives. I changed the selectors a bit in bf5cbc1
This reduces the complexity of the AbstractNav implementation, especially in regards to how the contexts are integrated with it.
This fixes the assertion issues caused by the selectors testing implementation details to find the DOM elements, rather than testing for something that is gauranteed to be in the implementation (E.g. the class `nav` on the Nav component, since it's part of the Bootstrap design spec) of the rendered DOM element.
Currently, we use a ref to gain access to the underlying component to implement our own functionality. However, this causes an issue with not allowing the user to forward their own ref to gain access to the underlying component. using `useMergedRefs`, we are able to forward both refs to the underlying component.