0
多くの画像を表示するコンポーネントを作成したいのですが、時間の経過後に1つの画像が変更されます。リアクションサイクリング画像ギャラリー
これまでのところ、私はこのコードを持っている:私はそれは6x6のグリッドからランダムに画像を切り替えると、画像からランダム画像でそれを切り替えたい
import React from 'react';
const Gallery = (props) => {
const cellStyle = {
background: "red",
padding: "0"
}
const ImageCell = (props) => {
return (
<div className="col-lg-4" style={cellStyle}>
<div style={{
height: "100%",
width: "100%",
padding: "0",
background: `url(${props.theImage})`,
backgroundSize: "cover"
}}
>
</div>
</div>
);
}
return(
<div className="row full-width">
{
props.images.map(function(image) {
let theKey = image.slice(14, -4);
return <ImageCell key={theKey} theImage={image} />
})
}
</div>
);
}
export default Gallery;
は、だから私は「ドン
を設定私はこれを実装する方法を本当に知っている、任意のアイデアは歓迎されます。