Explicitly convert displayName to string #578
Closed
FabianSellmann wants to merge 1 commit intoalgolia:masterfrom
Closed
Explicitly convert displayName to string #578FabianSellmann wants to merge 1 commit intoalgolia:masterfrom
FabianSellmann wants to merge 1 commit intoalgolia:masterfrom
Conversation
An React Elements displayName is not necessarily a string and Symbols are not automatically converted to strings.
|
There were the following issues with this Pull Request
You may need to change the commit messages to comply with the repository contributing guidelines. 🤖 This comment was generated by commitlint[bot]. Please report issues here. Happy coding! |
|
When you convert a symbol to a string it just says |
Collaborator
|
The PR #617 improve the support of special component case. I will close this one as it seems stale. If there is still an issue you can reopen it. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A React Elements displayName is not necessarily a string, and Symbols are not automatically converted to strings.
A case where the displayName is a symbol is for example the
React.Profilerelement.For reference symbols will throw error:
https://stackoverflow.com/questions/44425974/why-symbols-not-convert-string-implicitly
Same seems to happen for String.concat.
This would just be a simple fail safe change for the case where an elements displayName is a symbol.