我正在使用 react-motion 循环浏览一堆图像。我正在尝试在一定时间后以编程方式更改背景。
问问题
1186 次
1 回答
0
组件渲染应该是这样的。Motion 和 spring 来自“react-motion”包。查看照片演示的代码以获取更多详细信息。
<Motion style={{height: spring(currHeight), width: spring(currWidth)}}>
{container =>
<div className="demo4-inner" style={container}>
{configs.map((style, i) =>
<Motion key={i} style={style}>
{style =>
<img className="demo4-photo" src={`./${i}.jpg`} style={style} />
}
</Motion>
)}
</div>
}
</Motion>
于 2016-09-23T19:18:23.130 回答