@@ -10,7 +10,7 @@ tl;dr: [Based on Netflix TV Navigation System](https://medium.com/netflix-techbl
1010
1111[ See code from this example] ( https://github.com/react-tv/react-tv/blob/master/examples/navigation/src/App.js )
1212
13- React-TV-Navigation is a separated package from renderer to manage focusable components.
13+ React-TV-Navigation is a separated package from React-TV renderer to manage focusable components.
1414
1515## Installing
1616
@@ -24,7 +24,7 @@ React and [React-TV](http://github.com/react-tv/react-tv) are peer-dependencies.
2424
2525React-TV Navigation exports two functions: ` withFocusable ` and ` withNavigation ` .
2626
27- Navigation based on HOC and HOF beeing declarative .
27+ A declarative navigation system based on HOC's for focus and navigation control .
2828
2929``` jsx
3030import React from ' react'
@@ -40,28 +40,31 @@ const Item = ({focused, setFocus, focusPath}) => {
4040 )
4141}
4242
43- const Button = ({focused, setFocus, focusPath }) => {
43+ const Button = ({setFocus}) => {
4444 return (
45- <div onClick={() => { setFocus(' focusPath - 1 ' ) }}>
45+ <div onClick={() => { setFocus(' item - 1 ' ) }}>
4646 Back To First Item!
4747 </div>
4848 )
4949}
5050
51- const FocusableItem = withFocusable({focusPath: ' item- 1 ' })(Item)
52- const FocusableOtherItem = withFocusable({focusPath: ' item- 2 ' })(Item)
53- const FocusableButton = withFocusable({focusPath: ' button' })(Button)
51+ const FocusableItem = withFocusable(Item)
52+ const FocusableButton = withFocusable(Button)
5453
5554function App({currentFocusPath}) {
5655 return (
5756 <div>
5857 <h1>Current FocusPath: ' {currentFocusPath}' </h1>,
59- <FocusableItem/>
60- <FocusableOtherItem />
61- <FocusableButton/>
58+ <FocusableItem focusPath= ' item - 1 ' />
59+ <FocusableItem focusPath= ' item - 2 ' />
60+ <FocusableButton focusPath: ' button ' />
6261 </div>
6362 )
6463}
64+
65+ const NavigableApp = withNavigation(App)
66+
67+ ReactTV.render(<NavigableApp/>, document.querySelector(' #app' ))
6568```
6669
6770Soon we' ll write a decent README .md : )
0 commit comments