I have a large set of data need to listout in antd select box
.
the list is almost 126463 numbers of record
ex: ['gmail.com', 'yahoo.com', 'xyz.com'......]
I am using React antd select box to display these many data. but it becomes unresponsive and the browser hangs.
Can anyone help me how to handel this large data to display in antd select box ?
Code:
import React, { Component } from 'react';
import { Select } from 'antd';
import axios from 'axios';
export class EmailData extends React {
constructor(props) {
super(props);
this.state = {
email_domain_list: []
}
}
componentWillMount() {
this.listOutEmailDomain()
}
listOutEmailDomain() {
const getEmailDomain = {
method: "GET",
url: 'API TO GET EMAIL DOMAINS',
headers: {
"Content-Type": "application/json"
},
};
let resp = await axios(getEmailDomain);
if (resp) {
this.setState({
email_domain_list: resp.data.data
});
}
}
render(){
return <div>
<h6 className="email"><b>Email Data</b></h6>
<div>
<Select
showSearch
mode="tags"
size="large"
id={fieldConstants.emailDomain}
value={this.state.email_domain}
onChange={(e) => this.emailDomainChange(e)}
style={{ width: 390, marginLeft: 10 }} >
{
this.state.email_domain_list.map((item, index) => {
return (
<Option value={item} key={index}>{item}</Option>
)
})
}
</Select>
</div>
</div>
}
}