Skip to content

Commit cba8d7a

Browse files
committed
Simplify the example in the README.md
1 parent 5603523 commit cba8d7a

File tree

1 file changed

+11
-14
lines changed

1 file changed

+11
-14
lines changed

README.md

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -10,22 +10,19 @@ React Component for creating infinite range inputs.
1010

1111
```js
1212
import { InfiniteRange } from 'react-infinite-range'
13-
14-
const Form = ({ updateInputState }) => (
15-
<form>
16-
<InfiniteRange
17-
floor={100}
18-
ceiling={1000000000}
19-
step={100}
20-
chunkSize={500000}
21-
defaultValue={100}
22-
>
23-
{props => <input type="range" { ...props } />}
24-
</InfiniteRange>
25-
</form>
26-
)
13+
// In your render:
14+
<InfiniteRange
15+
floor={100}
16+
ceiling={1000000000}
17+
step={100}
18+
chunkSize={500000}
19+
defaultValue={100}
20+
>
21+
{props => <input type="range" { ...props } />}
22+
</InfiniteRange>
2723
```
2824

2925
### [Controlled](https://reactjs.org/docs/forms.html#controlled-components)
3026

3127
[InfiniteRange](/lib/InfiniteRange) owns the state of the input component and derives it from props. This is a design decision to hide implementation details from the consumer. Read more in [You Probably Don't Need Derived State](https://reactjs.org/blog/2018/06/07/you-probably-dont-need-derived-state.html).
28+

0 commit comments

Comments
 (0)