Skip to content

React Devtools should produce a better error message when integers are present as keys on react elements #17134

@alexkolson

Description

@alexkolson

Current behavior: React Devtools throws "RangError: Invalid Array Length" when integers are used as keys on react elements.

Example:

https://codesandbox.io/s/interesting-violet-v5c5j

https://v5c5j.csb.app/

Using anything but strings as keys is as far as I understand not even correct usage, but it would be great if react devtools checked a little bit earlier and had a nicer error than "RangeError: Invalid Array Length." It takes a long time to figure out from this message that one somehow managed to use integers as keys and needs to correct it.

I've only tested with Chrome and the latest version of react devtools as a chrome extension.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions