DEV Community

Discussion on: React: Using portals to make a modal popup

Collapse
 
link2twenty profile image
Andrew Bone

It's for future proofing, whenever I want a specific key I do it that way so I can add extra keys to the array down the line.

For instance if I wanted to add the enter key I would do this.

[27, 13].indexOf(e.which)