javascript - Pass drop down select value from react bootstrap -
i'm unable pass value react bootstrap dropdown function defined. also, i'm populating value category props. below code:
handledropdownchange = (evtkey) => { console.log(evtkey) } <dropdownbutton onselect={(event) => this.handledropdownchange(event)} title="" id="category-dropdown" > {category.map((category, i) => <menuitem key={i}>{category.path}</menuitem>)} </dropdownbutton>
the menuitem's key should eventkey.
<dropdownbutton onselect={this.handledropdownchange} title="" id="category-dropdown"> {category.map((category, i) => <menuitem eventkey={i}>{category.path}</menuitem>) } </dropdownbutton>
wiki
Comments
Post a Comment