Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const PriceSlider = (props) => {
- console.log(props)
- return (
- <div>
- <input
- type="range"
- min="1"
- max="9999"
- val={props.min}
- onChange={(e)=> {
- props.dispatch({type: 'ADJUST_MIN', payload: e.target.value})
- }}
- id="sliderMinRange"
- />
- <br/>
- <input
- type="range"
- min="2"
- max="9999"
- val={props.max}
- onChange={(e)=> {
- props.dispatch({type: 'ADJUST_MAX', payload: e.target.value})
- }}
- id="sliderMaxRange"
- />
- <p>MinValue: <span id="demo">{props.min}</span></p>
- <p>MiaxValue: <span id="demo">{props.max}</span></p>
- </div>
- )
- }
- function mapStateToProps(state){
- return {min: state.slider.sliderMinValue, max: state.slider.sliderMaxValue}
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement