question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Localized Inputs Break When Value Is Null

See original GitHub issue

Summary

LocalizedTextInput, LocalizedMultilineTextInput, LocalizedMoneyInput and LocalizedRichTextInput all crash when supplied with an undefined or null value prop.

I am not sure what the expected result would be, since we derive the languages from the value prop. So if value is undefined, we can’t render any inputs as we don’t know which language labels to use?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:18 (18 by maintainers)

github_iconTop GitHub Comments

1reaction
montezumecommented, Nov 6, 2019

We do provide it as a static function 😉.

So should I close this then?

1reaction
montezumecommented, Nov 4, 2019

Another option we have would be to do something like this (example from LocalizedTextInput)


const value = createLocalizedString(props.value);

Then it would not crash when we pass in invalid options. Might have performance implications though?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Breaking when a method returns null in the Eclipse debugger
I need to break and investigate when this method returns null. There are many paths and return statements. It is possible to break...
Read more >
Terraform 0.12.1 trates "null" as literal value instead of using ...
This issue is about being able to nullify individual input variables and have them use their defaults.
Read more >
String claims transformations - Azure AD B2C - Microsoft Learn
The error messages can be localized. ... Determines whether a claim value is equal to the input parameter value. ... Or null, if...
Read more >
check the variable is null right a… | Apple Developer Forums
So I want to do this like, if memberData?["login_date"] is null, just do not input a value,. if there is a value, just...
Read more >
Dynamic Breaks based on object state
So in other words, when the value you are interested in is about to be unassigned. To accomplish what you want, you would...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found