|
1 | | -# React-TV [](https://circleci.com/gh/raphamorim/react-tv) [](https://www.npmjs.com/package/react-tv) [](CONTRIBUTING.md#pull-requests) |
| 1 | +# [React-TV](https://github.com/raphamorim/react-tv) 📺 • [](https://circleci.com/gh/raphamorim/react-tv) [](https://www.npmjs.com/package/react-tv) [](CONTRIBUTING.md#pull-requests) |
2 | 2 |
|
3 | | -> React development for TV (WebOS, Tizen, Orsay) 📺 |
4 | | -
|
5 | | -> **tl;dr** It's like `react-DOM` for low memory applications and packager for TV as platform. |
| 3 | +> A `react-DOM` like for low memory applications and packager for TV as platform. |
6 | 4 |
|
7 | 5 |  |
8 | 6 |
|
9 | 7 | ```jsx |
10 | 8 | import React from 'react' |
11 | | -import ReactTV, { Platform } from 'react-tv' |
| 9 | +import ReactTV, { Platform } from 'ReactTV' |
12 | 10 |
|
13 | 11 | class Clock extends React.Component { |
14 | | - state = { date: new Date() } |
15 | | - |
16 | | - render() { |
17 | | - if (Platform.webos) { |
18 | | - return ( |
19 | | - <div> |
20 | | - <h1>Hello, {Platform}</h1> |
21 | | - <h2>It is {this.state.date.toLocaleTimeString()}</h2> |
22 | | - </div> |
23 | | - ) |
24 | | - } |
25 | | - |
26 | | - return <div>This App is available only at LG WebOS</div> |
27 | | - } |
| 12 | + state = { date: new Date() } |
| 13 | + |
| 14 | + componentDidMount() { |
| 15 | + setInterval(() => this.setState({date: new Date()}), 1000) |
| 16 | + } |
| 17 | + |
| 18 | + render() { |
| 19 | + if (Platform('webos')) { |
| 20 | + return ( |
| 21 | + <h1>Time is {this.state.date.toLocaleTimeString()}</h1> |
| 22 | + ) |
| 23 | + } |
| 24 | + |
| 25 | + return <h2>This App is available only at LG WebOS</h2> |
| 26 | + } |
28 | 27 | } |
29 | 28 |
|
30 | | -ReactTV.render(Clock, document.getElementById('root')) |
| 29 | +ReactTV.render(<Clock/>, document.getElementById('root')) |
31 | 30 | ``` |
32 | 31 |
|
33 | 32 | ## Summary |
34 | 33 |
|
35 | 34 | - [About React-TV](#about-react-tv) |
36 | | - - [Understanding the Problem](#understanding-the-problem) |
| 35 | + - [Understanding the Problem](#understanding-the-problem) |
37 | 36 | - [Getting Started](#getting-started) |
38 | | - - [Installing](#installing) |
39 | | - - [Examples](#examples) |
40 | | - - [Using CLI](#using-cli) |
41 | | - - [Using Module](#using-module) |
| 37 | + - [Installing](#installing) |
| 38 | + - [Examples](#examples) |
| 39 | + - [Using CLI](#using-cli) |
| 40 | + - [Using Module](#using-module) |
42 | 41 | - [Supported Televisions](#supported-televisions) |
43 | | - - [LG WebOS](#lg-webos) |
| 42 | + - [LG WebOS](#lg-webos) |
44 | 43 | - [References for Study](#references) |
45 | | - - [WebOS](#webos) |
46 | | - - [Videos](#videos) |
47 | | - - [Essentials to beginner](#essentials-to-beginner) |
48 | | - - [React Basics and Renderer Architecture](#react-basics-and-renderer-architecture) |
| 44 | + - [WebOS](#webos) |
| 45 | + - [Videos](#videos) |
| 46 | + - [Essentials to beginner](#essentials-to-beginner) |
| 47 | + - [React Basics and Renderer Architecture](#react-basics-and-renderer-architecture) |
49 | 48 | - [TODOLIST for 1.0.0](#todolist) |
50 | 49 |
|
51 | 50 | ## About React-TV |
@@ -218,25 +217,25 @@ Thanks [react-dom](https://github.com/facebook/react/tree/master/packages/react- |
218 | 217 | ## TODOLIST |
219 | 218 |
|
220 | 219 | - [ ] {cli} init project |
221 | | - - [x] mkdir app-path |
222 | | - - [x] generate react app tv based on app-name and app-path |
223 | | - - [ ] create a npm script on app: `react-tv run-webos-dev` |
| 220 | + - [x] mkdir app-path |
| 221 | + - [x] generate react app tv based on app-name and app-path |
| 222 | + - [ ] create a npm script on app: `react-tv run-webos-dev` |
224 | 223 | - [ ] {cli} run-webos-dev |
225 | | - - [ ] mount bundle (crow-scripts) or Webpack |
226 | | - - [ ] check if exists webpack config existent on folder |
227 | | - - [ ] copy bundle for respective folders |
228 | | - - [x] run server (express?) |
| 224 | + - [ ] mount bundle (crow-scripts) or Webpack |
| 225 | + - [ ] check if exists webpack config existent on folder |
| 226 | + - [ ] copy bundle for respective folders |
| 227 | + - [x] run server (express?) |
229 | 228 | - [ ] {cli} run-webos |
230 | | - - [ ] CROW bundling or Webpack |
231 | | - - [ ] Check executable bin path for Windows, OSX and Linux |
232 | | - - [x] pack and install script |
233 | | - - [x] check if virtualbox is up |
234 | | - - [x] launch |
235 | | - - [x] `--disable-emulator` |
| 229 | + - [ ] CROW bundling or Webpack |
| 230 | + - [ ] Check executable bin path for Windows, OSX and Linux |
| 231 | + - [x] pack and install script |
| 232 | + - [x] check if virtualbox is up |
| 233 | + - [x] launch |
| 234 | + - [x] `--disable-emulator` |
236 | 235 | - [ ] {renderer} |
237 | | - - [ ] WebOS |
238 | | - - [x] platform |
239 | | - - [ ] volume |
240 | | - - [ ] Tizen |
241 | | - - [ ] platform |
242 | | - - [ ] volume |
| 236 | + - [ ] WebOS |
| 237 | + - [x] platform |
| 238 | + - [ ] volume |
| 239 | + - [ ] Tizen |
| 240 | + - [ ] platform |
| 241 | + - [ ] volume |
0 commit comments