diff --git a/example/src/examples/PaginationExample.react.js b/example/src/examples/PaginationExample.react.js index 6e927ad4..8f4d37cd 100644 --- a/example/src/examples/PaginationExample.react.js +++ b/example/src/examples/PaginationExample.react.js @@ -9,7 +9,7 @@ import Control from '../components/Control.react'; /* eslint-disable no-console */ /* example-start */ -const options = range(0, 1000).map((o) => o.toString()); +const options = range(0, 1000).map((o) => `Item ${o}`); class PaginationExample extends React.Component { state = { diff --git a/example/src/examples/RenderingExample.react.js b/example/src/examples/RenderingExample.react.js index bf4b1a49..48fd3efc 100644 --- a/example/src/examples/RenderingExample.react.js +++ b/example/src/examples/RenderingExample.react.js @@ -1,6 +1,6 @@ /* eslint-disable import/no-extraneous-dependencies,import/no-unresolved */ -import { groupBy, map } from 'lodash'; +import { groupBy } from 'lodash'; import React, { Fragment } from 'react'; import { FormControl, FormGroup } from 'react-bootstrap'; import { Highlighter, hintContainer, Menu, MenuItem, Token, Typeahead } from 'react-bootstrap-typeahead'; @@ -74,26 +74,26 @@ class RenderingExample extends React.Component { return ; } - _renderMenu = (results, menuProps) => { - let idx = 0; - const grouped = groupBy(results, (r) => r.region); - const items = Object.keys(grouped).sort().map((region) => [ - !!idx && , - - {region} - , - map(grouped[region], (state) => { - const item = - - - {state.name} - - ; + _renderMenu = (results, menuProps, state) => { + let index = 0; + const regions = groupBy(results, 'region'); + const items = Object.keys(regions).sort().map((region) => ( + + {index !== 0 && } + {region} + {regions[region].map((i) => { + const item = + + + {i.name} + + ; - idx++; /* eslint-disable-line no-plusplus */ - return item; - }), - ]); + index += 1; + return item; + })} + + )); return {items}; }