Select控制台提示警告 antd

控制台提示下面警告,这个该怎么弄呢
Warning: the children of Select should be Select.Option or Select.OptGroup, instead of Option.


<Select
              showSearch
              style={{ width: 260,height: 32 }}
              placeholder={this.state.userSele}
              optionFilterProp="children"
              allowClear={true}
              onChange={this.stockCodeSelect}
              filterOption={(input,option) => option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0}
            >
              {
                arr.map((item,index) => (
                  <Option value={item.CODE} key={index}>{item.NAME}</Option>
                )) 
              }
            </Select>
阅读 9.2k
1 个回答

是不是你在引用的位置没有引用,const Option = Select.Option;

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题