-
-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
API Addition: findByClass
#1629
Comments
Similar to #349 but different in that it matches class names exactly, not by |
The "special native method" you mention is a legacy one; the modern API is to only use querySelector/querySelectorAll. I think that "find by class" is a pattern that shouldn't be common; either way, I think adding a specialized convenience method to avoid prepending a |
What? Why? How else should you find elements?
You're ignoring the first scenario, which is actually really common. |
@danny-andrews-snap |
Not sure that's the whole story. On my computer (macOS 10.12 Chrome 66) |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
@craigkovatch if you're selecting enough DOM elements that 3200x even matters, you've got something subpar with your architecture :-) |
I'm going to close this; the added complexity in enzyme isn't worth it for the simple sugar of avoiding a template literal with a leading dot. |
I think it would be really nice to have a
findByClass
(or equivalent) method. 99% of the time, I select portions of the DOM by class, and when using css-modules, you end up having to do awkward thingslike
to select them.
would be much nicer.
Even in the normal case, it would nicer (albeit slightly) to do
rather than
The text was updated successfully, but these errors were encountered: