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

toString on classname? #10857

Closed
bradennapier opened this issue Sep 27, 2017 · 3 comments
Closed

toString on classname? #10857

bradennapier opened this issue Sep 27, 2017 · 3 comments

Comments

@bradennapier
Copy link

bradennapier commented Sep 27, 2017

Did react used to call .toString() on non string objects it would receive? A few packages are not working anymore and as far as I can tell this is likely the reason. Specifically anything using bem-cn or similar.

Might be something to add to docs as a breaking change.

Can't figure out why else a few components are suddenly throwing errors and dont have any styles on them.

@katsos
Copy link

katsos commented Sep 27, 2017

Please provide a plunker.

@gaearon
Copy link
Collaborator

gaearon commented Sep 27, 2017

Please see #10756.

The change was intentional and this is the only library I can see affected so far. The way it works is highly unusual and I believe the benefits of the change (bugs are easier to find) outweigh the downside (a library with an unconventional API stops working).

To be clear we only stopped calling toString on functions. Usually it's their source code, so it's very uncommon to overwrite it to mean something else.

Happy to take PRs mentioning it more prominently in the changelog.

@gaearon gaearon closed this as completed Sep 27, 2017
@bradennapier
Copy link
Author

Thanks again @gaearon . I agree that it shouldn't accept functions , just wanted to make sure I wasn't crazy :-P

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