rsvp-reader/src/components/RsvpOptions.js

22 lines
478 B
JavaScript
Raw Normal View History

2019-12-13 00:16:53 +01:00
import React from 'react'
import { useSelector, useDispatch } from 'react-redux'
import { setMaxLength } from '../store/actions'
export const RsvpOptions = () => {
const maxLength = useSelector(state => state.maxLength)
const dispatch = useDispatch()
return (
<div>
<input
type="range"
min="3"
max="14"
value={maxLength}
onChange={e => dispatch(setMaxLength(e.target.value))}
/>
{maxLength}
</div>
)
}