ToolbarButton dynamic render

I am developing a ToolbarButton extension which is a dropdown list (similar to Code/Markdown/Raw) but in my case the dropdown options need to be fetched using http get. While I can fetch the data but the return part of render() doesn’t get updated.I am doing something like:

render {
let data = []
const getData = async() => {
    //update data variable
return (
<select onClick={getData}>
<option>{data.toString()}</option> //Just for checking

Please help me with a solution to this.