Skip to content

Commit

Permalink
Simplify README examples
Browse files Browse the repository at this point in the history
Avoid using `action` within the sample code, as it caused some
confusion with non-redux users. (#10)
  • Loading branch information
PatrickDesign committed Dec 17, 2020
1 parent ce49c4d commit 0f76849
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,10 @@ const list = [{
list={list}
keys={['author', 'title']}
width={430}
onSelect={action('selected')}
onSelect={(newSelectedItem) => {
// Local state setter defined elsewhere
setSelectedItem(newSelectedItem)
}}
/>
```

Expand All @@ -38,7 +41,10 @@ const list = [{
list={list}
keys={['author', 'title']}
width={430}
onSelect={action('selected')}
onSelect={(newSelectedItem) => {
// Local state setter defined elsewhere
setSelectedItem(newSelectedItem)
}}
resultsTemplate={(props, state, styles, clickHandler) => {
return state.results.map((val, i) => {
const style = state.selectedIndex === i ? styles.selectedResultStyle : styles.resultsStyle;
Expand Down

0 comments on commit 0f76849

Please sign in to comment.