Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/reactjs/23.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Reactjs 为什么';我的复选框不会出现在react中吗?_Reactjs - Fatal编程技术网

Reactjs 为什么';我的复选框不会出现在react中吗?

Reactjs 为什么';我的复选框不会出现在react中吗?,reactjs,Reactjs,我有一个问题,Size组件没有显示在网页上。有人能帮我弄清楚吗 这是我的文件层次结构: components CheckBoxes index.js style.css Shelf Filter index.js style.css 这是我的“components/Shelf/Filter/index.js”: 不返回数组 createCheckboxes = () => {

我有一个问题,
Size
组件没有显示在网页上。有人能帮我弄清楚吗

这是我的文件层次结构:

components
    CheckBoxes
        index.js
        style.css

    Shelf
        Filter
            index.js
            style.css
这是我的“components/Shelf/Filter/index.js”:


不返回数组

createCheckboxes = () => {
    return this.availableSizes.map((size) => {
        return < Size size={size}/>
    });
}
createcheckbox=()=>{
返回此.availableSizes.map((大小)=>{
返回
});
}

oooops,我有多粗心。谢谢你的回答!:)
import React, { Component } from 'react';
import "./style.css";

const Size = props => {
    return <div className='size'>{props.size}</div>
}

export default Size;
.size {
background-color: rgb(223, 220, 220);
display: inline-block;
position: relative;
cursor: pointer;
font-size: 22px;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
width: 35px;
height: 35px;
font-size: 0.8em;
margin-bottom: 8px;
margin-right: 8px;
border-radius: 50%;
line-height: 35px;
text-align: center;
}

.size:hover { 
    border: 1px solid #1b1a20;
  }
createCheckboxes = () => {
    return this.availableSizes.map((size) => {
        return < Size size={size}/>
    });
}