0
배열의 여러 항목을 각 행의 3 열 그리드에 매핑하려고합니다. 지금은 전체 격자를 하드 코딩했지만, 자동으로 이렇게하는 것이 쉽습니다. 여기NativeBase : 행에 열 생성
<Grid>
<Col>
<Row>Cel 1</Row>
<Row>Cel 2</Row>
<Row>Cel 3</Row>
</Col>
<Col>
<Row>Cel 4</Row>
<Row>Cel 5</Row>
<Row>Cel 6</Row>
</Col>
<Col>
<Row>Cel 4</Row>
<Row>Cel 5</Row>
<Row>Cel 6</Row>
</Col>
<Col>
<Row>Cel 4</Row>
<Row>Cel 5</Row>
<Row>Cel 6</Row>
</Col>
<Col>
<Row>Cel 4</Row>
<Row>Cel 5</Row>
<Row>Cel 6</Row>
</Col>
</Grid>
많은 기압을하지 않는 렌더링 방법은 다음과 같습니다
이 최종 결과가 어떻게 보일지입니다. 이 이슈를 어떻게 시작해야할지 모르겠다. 이미지가 업데이트받을 때 (삽입, 삭제 또는 삭제), React
다시 render
구성 요소를 다시 때문에 가능한
render() {
let images = [
Images.grid1,
Images.grid2,
Images.grid3,
Images.grid4,
Images.grid5,
Images.grid6,
Images.grid7,
Images.grid8,
Images.grid9
];
return images.map(link => {
return (
<Grid>
<Row>
<Col>link</Col>
<Col>link</Col>
<Col>link</Col>
</Row>
<Row>
<Col>link</Col>
<Col>link</Col>
<Col>link</Col>
</Row>
</Grid>
);
});
}
감사합니다. 요청한대로 작동합니다. – Fullhdpixel
소품이 없습니다. 내 기쁨 이었어. –