# Remote control in react js

**URL:** <https://forum.webostv.developer.lge.com/t/remote-control-in-react-js/2299>\
**Category:** Web App Development\
**Created:** [March 8, 2023, 2:11am UTC](https://forum.webostv.developer.lge.com/t/remote-control-in-react-js/2299 "2023-03-08T02:11:07Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![user1790](https://avatars.discourse-cdn.com/v4/letter/u/e19adc/32.png) [@user1790](https://forum.webostv.developer.lge.com/u/user1790)\
**Post date:** [March 8, 2023, 2:11am UTC](https://forum.webostv.developer.lge.com/t/remote-control-in-react-js/2299/1 "2023-03-08T02:11:07Z")

</div>

I am developing a hosted web app using reactjs. Is it possible to move the focus of multiple components by pressing the direction keys on the remote control with the ref of react?

---

<div class="post-metadata">

**Author:** ![narae0.kim](https://avatars.discourse-cdn.com/v4/letter/n/87869e/32.png) [@narae0.kim](https://forum.webostv.developer.lge.com/u/narae0.kim)\
**Post date:** [March 9, 2023, 9:07am UTC](https://forum.webostv.developer.lge.com/t/remote-control-in-react-js/2299/2 "2023-03-09T09:07:56Z")

</div>

Please use the event listener as follows:

```auto
document.addEventListener(
  "keydown",
  function(event) {
    console.log("keydown", event.keyCode);
  },
  false
);

```
