Advertisement
Guest User

Untitled

a guest
Sep 18th, 2019
135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.03 KB | None | 0 0
  1. const PriceSlider = (props) => {
  2.  
  3. console.log(props)
  4. return (
  5. <div>
  6. <input
  7. type="range"
  8. min="1"
  9. max="9999"
  10. val={props.min}
  11. onChange={(e)=> {
  12. props.dispatch({type: 'ADJUST_MIN', payload: e.target.value})
  13. }}
  14. id="sliderMinRange"
  15. />
  16. <br/>
  17. <input
  18. type="range"
  19. min="2"
  20. max="9999"
  21. val={props.max}
  22. onChange={(e)=> {
  23. props.dispatch({type: 'ADJUST_MAX', payload: e.target.value})
  24. }}
  25. id="sliderMaxRange"
  26. />
  27. <p>MinValue: <span id="demo">{props.min}</span></p>
  28. <p>MiaxValue: <span id="demo">{props.max}</span></p>
  29. </div>
  30. )
  31. }
  32. function mapStateToProps(state){
  33. return {min: state.slider.sliderMinValue, max: state.slider.sliderMaxValue}
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement