title: Handling key events in React JS
body: <p>I'm using Javascript (React JS) to build a component that needs to listen to the left and right arrow keys. My component is a card that has a list of images. When an image is clicked, it is displayed, but I want to be able to hit the right and left arrow keys and navigate images. </p>
  
  <p>I have a bunch of nested divs and I'm trying to figure out which one should have the onKeyPress listener assigned. Right now I have it assigned to many divs, but I don't see an event being fired. </p>