[英]Render an array to rows with styled-component
I have a simple array here that I am trying to render into a grid.我在这里有一个简单的数组,我试图将其渲染到网格中。
This code below renders the array as:下面的代码将数组呈现为:
HAMDDN汉密尔顿
I want to render it such that the following will result in a different row我想呈现它,以便以下将导致不同的行
HA
MD
DN
Any thoughts?有什么想法吗? The full code is below.
完整代码如下。 I know this is a simple task but I am a newbie.
我知道这是一项简单的任务,但我是新手。 Thanks!
谢谢!
import React from 'react';
import styled from 'styled-components';
import Page from '../Shared/Page'
export const StateGrid = styled.div`
display:inline-block;
`;
const list =[
"HA", "MD", "DN"
]
function States () {
return (
<Page name="statistics">
<StateGrid>{list}</StateGrid>
</Page>
);
}
export default function() {
return (
<States/>
);
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.