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

Don't error on empty string input to <Color> #219

Merged
merged 4 commits into from
Jul 30, 2019

Conversation

benfletcher
Copy link
Contributor

Even though only dev error, it's convenient to not have to guard against temporarily empty strings getting passed to .

Obviously, this is just a suggestion and one of many ways to implement. It's easy enough to write a wrapper around to handle this if that's preferred.

The specific use case is rendering of fields in color that may, at times, be empty strings.

I don't use Typescript, so sorry if this breaks something in that world.

Even though only dev error, it's convenient to not have to guard against temporarily empty strings getting passed to <Color>.

Obviously, this is just a suggestion and one of many ways to implement. It's easy enough to write a wrapper around <Color> to handle this if that's preferred.

The specific use case is rendering of fields in color that may, at times, be empty strings.
@vadimdemedes
Copy link
Owner

Could you add a test for it? Also, CI is failing.

Color shouldn't throw if it receives undefined children.
@benfletcher
Copy link
Contributor Author

I think everything looks good now. I added a test adjacent to another Color test. Not sure if that's the best place for it. Let me know if any other problems. Sorry for the multiple commits. Wasn't in a position to easily manage them.

@vadimdemedes
Copy link
Owner

LGTM, thanks!

@vadimdemedes vadimdemedes merged commit 46f243d into vadimdemedes:master Jul 30, 2019
jedahan pushed a commit to jedahan/ink-1 that referenced this pull request Sep 7, 2019
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.

2 participants