How can I get dropdown options populated from state?

I can’t seem to get a select element to have options based on elements of an array in state. I’ve tried a bunch of different methods, but this seemed to be the most granular (I’m just getting back into react after a few years, and am trying to relearn it).

I have a whole stateful component for the dropdown, shown below:

import React, { Component } from "react";
import "./Dropdown.css";

class Dropdown extends Component {
  constructor(props) {
    this.state = {
      options: [],
      selectedOption: "",

  componentDidMount = () => {
      options: this.props.options

  displayOptions = () => { => {
      return <option value={item} id="1">{item}</option>

  render() {
      <select className="dropdown">
        { this.displayOptions() }

export default Dropdown;

The props that are being pulled in are structured as an array of either strings or numbers. As an example:


Looking at my React dev tools, state is getting correctly populated with the array. And according to my understanding of React, once state is populated, the component should rerender, calling displayOptions, mapping through the array, and filling the select element with option elements.

But when I go to the actual page, no matter how long I wait or what I do, the dropdown never opens to show options. I guess I can’t tell if I just have a typo that’s keeping this from working properly, or if I’m missing a larger rule of either React, array prototypes, or something else entirely.

Any help would be greatly appreciated. And please let me know if more information is needed. I feel like I’ve provided all relevant info, but I’m happy to provide more if needed.

92 thoughts on “How can I get dropdown options populated from state?”

Leave a Comment