Skip to content
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

Rename toContainReact #328

Open
mvasin opened this issue Nov 1, 2019 · 3 comments
Open

Rename toContainReact #328

mvasin opened this issue Nov 1, 2019 · 3 comments

Comments

@mvasin
Copy link

mvasin commented Nov 1, 2019

toContainReact looks like an irrelevant name to me.

An instance of a component <MyComponent /> (as opposed to the component itself function MyComponent() {}) according to React core team blog should be called Element. So the name could be toContainElement, but there is already toContainMatchingElement, so it will look confusing.

Anyway, toContainReact doesn't look like an appropriate name, let's come up with a better one. Maybe toContainComponentInstance.

@blainekasten
Copy link
Collaborator

@mvasin you are absolutely right.

It seems like what is proper would be the following breaking changes:

  • toContainReact -> toContainElement
  • toContainMatchingElement -> toContainElementBySelector
  • toContainMatchingElements -> toContainElementsBySelector
  • toContainExactlyOneMatchingElement -> toContainExactlyOneElementBySelector

toMatchElement and toMatchSelector already have the right syntax and it should be standardized. Would you be willing to make these changes for us?

@mvasin
Copy link
Author

mvasin commented Nov 4, 2019

It's great to see your support! I'll be happy to do it.

@blainekasten
Copy link
Collaborator

Thanks @mvasin! Of course. I've felt weird about some of these APIs but hadn't given it much thought lately.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants