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.

v2 no longer accepts undefined and null values for creatable

See original GitHub issue
Uncaught TypeError: Cannot read property 'toLowerCase' of null
    at compareOption (modules.js?hash=dd58b4ecfe7b96bbf9be666342adcbc6603f96e6:58050)
    at modules.js?hash=dd58b4ecfe7b96bbf9be666342adcbc6603f96e6:58059
    at Array.some (<anonymous>)
    at isValidNewOption (modules.js?hash=dd58b4ecfe7b96bbf9be666342adcbc6603f96e6:58058)
    at Creatable.componentWillReceiveProps (modules.js?hash=dd58b4ecfe7b96bbf9be666342adcbc6603f96e6:58143)
    at modules.js?hash=dd58b4ecfe7b96bbf9be666342adcbc6603f96e6:24020
    at measureLifeCyclePerf (modules.js?hash=dd58b4ecfe7b96bbf9be666342adcbc6603f96e6:23485)
    at ReactCompositeComponentWrapper.updateComponent (modules.js?hash=dd58b4ecfe7b96bbf9be666342adcbc6603f96e6:24019)
    at ReactCompositeComponentWrapper.receiveComponent (modules.js?hash=dd58b4ecfe7b96bbf9be666342adcbc6603f96e6:23956)
    at Object.receiveComponent (modules.js?hash=dd58b4ecfe7b96bbf9be666342adcbc6603f96e6:16601)

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:8
  • Comments:17 (2 by maintainers)

github_iconTop GitHub Comments

5reactions
abdi-mohamedcommented, Nov 1, 2018

same issue +1

4reactions
vladinator1000commented, Nov 26, 2018

I’ve made a pull request that should fix this, until it gets accepted, here’s a workaround. Your option’s value needs to be a string:

const defaultOption = {
  label: 'hello',
  value: String(yourValue),
};
Read more comments on GitHub >

github_iconTop Results From Across the Web

Is there a way to check for both `null` and `undefined`?
Using a juggling-check, you can test both null and undefined in one hit: if (x == null) {. If you use a strict-check,...
Read more >
Documentation - TypeScript 2.0
Null - and undefined-aware types. TypeScript has two special types, Null and Undefined, that have the values null and undefined respectively.
Read more >
How to Avoid the Infamous "Cannot read properties of ... - Bitovi
That error message is telling you the function is returning undefined implicitly, but its return type does not include undefined in it. Awesome!...
Read more >
Handling null and undefined in JavaScript | by Eric Elliott
In some statically typed languages, you can say that null and undefined are illegal values, and let your programming language throw a TypeError ......
Read more >
null - JavaScript - MDN Web Docs - Mozilla
The value null is written with a literal: null . null is not an identifier for a property of the global object, like...
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