over_react
over_react copied to clipboard
UIP-3014 Warn when key uses default toString impl
With key being dynamic and toString-ing values, it's easy to pass in any object.
It's also easy to pass in objects with non-unique toString implementations, such as the default Object.toString, and not notice that the value won't help when keying.
class Foo {
final bar;
Foo(this.bar);
}
..key = new Foo(1) // Uses "Instance of 'Foo'" as key
..key = new Foo(2) // Uses "Instance of 'Foo'" as key
We should check whether values like this are specified (perhaps via a regex, like ^Instance of '[_\$a-zA-Z0-9]+'$) and warn in the console.
It looks like you have not included any tickets in the title of this issue. Please create a ticket for this issue, or click a type to create one automatically: Task, Bug, Improvement