Javascript Can';t使用react spring设置html进度动画
我正在尝试使用react-spring制作html条元素的动画,如下所示:Javascript Can';t使用react spring设置html进度动画,javascript,html,reactjs,react-hooks,react-spring,Javascript,Html,Reactjs,React Hooks,React Spring,我正在尝试使用react-spring制作html条元素的动画,如下所示: import { useSpring, animated } from 'react-spring' const Example = ()=> { const props = useSpring({ value: 320, from: { value: 0 } }); return ( <animated.div> <progress style={{wi
import { useSpring, animated } from 'react-spring'
const Example = ()=> {
const props = useSpring({ value: 320, from: { value: 0 } });
return (
<animated.div>
<progress style={{width:"70%"}} id="file" value={props.value} max="1000"/>
<animated.div/>
)
}
从'react spring'导入{useSpring,动画}
常量示例=()=>{
constprops=useSpring({value:320,from:{value:0});
返回(
谢谢尝试使用动画版的progress。并使用道具中的值
<div>
<animated.progress id="file" value={props.value} max="1000" />
</div>
CodeSandbox中的html条值从0上升到320?我再次更新了CodeSandbox