import React from "react"; var values; class DropDown extends React.Component { constructor() { super(); this.state = { options: [], }; } componentDidMount() { this.fetchOptions(); } fetchOptions() { fetch("/getStreamNames") .then((res) => { return res.json(); }) .then((json) => { values = json; let arr = []; values.forEach((element) => { arr.push(element.streamName); }); this.setState({ options: arr }); }); } state = { value: "Large" }; handleChange = (event) => { this.setState({ value: event.target.value }); } render() { return (
); } } export default DropDown;