Material UI Range Min Max Error: Cannot read property 'focus' of null

Material UI Range Min Max Error: Cannot read property 'focus' of null

我是 React 和 MaterialUI 的新手。我正在尝试 range filter with min and max inputs and range line using MaterialUI and it example with number-format。 如果我将道具 'value' 用于 Slider,当我尝试移动拇指时,会抛出错误:

Uncaught TypeError: Cannot read property 'focus' of null.

但并非所有时候。 如果我使用 prop 'defaultValue' 则没有这样的错误,但在控制台中是另一个错误:

Material-UI: A component is changing the default value state of an uncontrolled Slider after being initialized. To suppress this warning opt to use a controlled Slider.

我应该怎么做才能让它发挥作用? Code in Sandbox

要消除该警告,请执行以下操作:

setValues({
  ...values,
  [name]: Number(value)
});

API 说它期待 Number 但你提供的是字符串