DEV Community

Discussion on: React JS for Smart TV - discussion

Collapse
 
pdrmdrs profile image
Pedro Paulo Paiva de Medeiros • Edited

Hi,

I'm actually working with Samsung, LG and Panasonic. Since they all use a web browser behind the scenes, the work I have is to control the focus. With the browser focused on a element that has a onClick event, when the use press the Enter key on the remote control, it should work fine.

A example should be like this:

That's how I've done to handle the click events on the TVs, :D

Collapse
 
rationalmachines profile image
Shawn Sheehan

Im curious if you had any trouble with links, this project i'm looking over for a friend everything works fine as he intended on desktop and mobile but the links do not work on smart tvs?

Thread Thread
 
pdrmdrs profile image
Pedro Paulo Paiva de Medeiros

Do you mean the tag? If yes, in some devices it could not work properly, because the TVs runs the apps in a sandbox mode, so every redirect or link to another html page will open the TV browser, instead of staying on the app that was running.

To deal with this, I use react-router-dom on my app to make him a Single Page Application and navigate between routes using the Link and NavLink components.
For a better compatibility, I use the HashRouter component instead of the BrowserRouter that is commonly used.

Is that your case? If not, tell more details and we can figure out something, :D