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

Split out internal react properties from the user supplied props #2656

Closed
wereHamster opened this issue Dec 4, 2014 · 2 comments
Closed

Comments

@wereHamster
Copy link

By internal react properties I mean ref and key. The current API design forces users to mix those two into a single object. This is unfortunate in the case that the user wants to have props with the same name.

The ReactElement solves that problem nicely because it takes the key, ref and props as separate arguments. I understand that the current API is designed around a single props object, and the rest is treated as children. But I believe making explicit distinction between user supplied props and those used for internal purposes will lead to less confusion.

@chrislaughlin
Copy link

@wereHamster how would this translate into JSX, using the createElement does allow you to break things up but not sure how this would be achieved via JSX unless to passed the props as an attribute e.g. <Test ref='test' props={myProps} />

@jimfb
Copy link
Contributor

jimfb commented Jan 4, 2016

I agree with @chrislaughlin, supporting the use of those two props as valid user-defined props would be detrimental to anyone using JSX (since there is currently no way of specifying them). For this reason, we probably aren't going to support it in the near future. Feel free to continue the discussion on this thread, and we can re-open if our thinking on this matter changes substantially.

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

3 participants