React JS for Smart TV - discussion

・1 min read

Hi,

I'm developing an App for SmartTV with React JS (well, trying to, haha) and was wondering if anyone have done something similar or know something about.

I'm not using React Native because the TV brands that

This post is to share knowledge about that topic and have a good conversation.

Feel free to ask something about it, I would be glad to answer what I know, :3

To start a discussion, I will ask: someone has implemented a way to handle navigation by arrow keys on the keyboard?

DISCUSS (4)
 

Im curious, how did you handle click events? They do not seem to work on smart-tvs

 

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

 

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?

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

Classic DEV Post from Nov 14 '18

Are we Developers helping Google to build an unstoppable monopoly?

Google was awesome because of the fact that it provides us with great tools for free. But we have paid a huge cost for that.

Young developer, 5 years working on the development area, working with React and GraphQL for 1 year, looking to learn NodeJS at small steps at the moment. Student at the UFRN
DEV.join()

Come for the ideas.
Stay for the community.