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

Return UNDEFINED if type neither string nor function in ReactElement plugin #4360

Merged
merged 1 commit into from
Aug 25, 2017

Conversation

pedrottimark
Copy link
Contributor

Summary

Fixes #3823

The same “tag name” for anonymous function and undefined type seems confusing, therefore:

  • <Unknown> if type is anonymous function as it has been
  • <UNDEFINED> if type is neither string nor function

We think it seems easier to see and solve the problem if tests make it obvious (assuming that people review snapshots before committing :) than if the plugin throws an error.

Test plan

Updated the existing test for this case

@github-actions
Copy link

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 13, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Discussion: pretty-format with React element of type undefined renders Unknown in snapshot
3 participants