Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Make React.forwardRef() components discoverable by TestRenderer traversal #12725
This is interesting. You can find-by-type to verify that a thing is rendered in a tree (which seems useful in some cases I guess) - but the thing you find probably won't be what you expected it to be (e.g. it will be the
Maybe that's not a problem in practice?
I guess it depends on what you want to assert on it. You can check that it gets rendered and that it has props you expect. If you want to you can go deeper (similar to what would happen if you introduced a functional component at the top). So I think that's okay.