Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/reactjs/27.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
Javascript 反应片段为';输入组件的t工作_Javascript_Reactjs_React Native - Fatal编程技术网

Javascript 反应片段为';输入组件的t工作

Javascript 反应片段为';输入组件的t工作,javascript,reactjs,react-native,Javascript,Reactjs,React Native,有没有其他方法可以在不使用React.Fragment的情况下编写以下代码,因为这样做不起作用 <FormGroup> <Input type="select" name="selectMultiPrefs" id="MultiPrefs" multiple> {this.state.arrayForCategs.map(function (CategName, index) {

有没有其他方法可以在不使用React.Fragment的情况下编写以下代码,因为这样做不起作用

          <FormGroup>
            <Input type="select" name="selectMultiPrefs" id="MultiPrefs" multiple>
              {this.state.arrayForCategs.map(function (CategName, index) {
                return (
                   <React.Fragment key={keyNum++}>
                    <option key={keyNum++} value={CategName} disabled>{CategName}</option>
                 {that.props.general.adprefrec.map(function (AdSingle, index) {
                   <option key={keyNum++} value={AdSingle.prefid}>{AdSingle.name}</option>
                 })}
                   </React.Fragment>
                )
              })}
            </Input>
          </FormGroup>

{this.state.arrayForCategs.map(函数(CategName,index){
返回(
{CategName}
{that.props.general.adprerec.map(函数(AdSingle,index){
{AdSingle.name}
})}
)
})}

这不起作用,因为没有
这样的东西

您想使用