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

fix: Don't error on 'null' in HTML templates #5602

Merged
merged 4 commits into from
Apr 5, 2022

Conversation

mwest1066
Copy link
Member

Because typeof null === 'object', we would previously throw an error when trying to render null values:

} else if (typeof value === 'object') {

This PR also prints a more informative error message when an object can't be rendered.

@nwalters512 can you remind me how to release a new version of this library after this PR is merged?

@nwalters512
Copy link
Contributor

@mwest1066 as part of this PR, run yarn changeset in the root of the repo. Select this package, answer the prompts, commit the result. Automated tooling should open a new PR that bumps the version and updates the changelog; merge that, and it'll get published automatically!

Copy link
Contributor

@nwalters512 nwalters512 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would appreciate it if you could add a test for this new behavior!

@mwest1066
Copy link
Member Author

Would appreciate it if you could add a test for this new behavior!

Thanks for the reminder! Added in 48be0d2

@mwest1066 mwest1066 merged commit 5752fab into master Apr 5, 2022
@mwest1066 mwest1066 deleted the fix/html-template-null branch April 5, 2022 12:50
nwalters512 pushed a commit that referenced this pull request Apr 11, 2022
* fix: Don't render 'null' in HTML templates

* Add test for null handling

* Add changeset for html package
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

Successfully merging this pull request may close these issues.

None yet

2 participants