Fauntleroy / react-simple-dropdown

Non-prescriptive React.js dropdown toolkit
ISC License
225 stars 75 forks source link

Cannot map inside dropdown menu #48

Closed thebedroomprogrammer closed 7 years ago

thebedroomprogrammer commented 7 years ago

So I have a status list of each seller that I want to map inside dropdown menu as list. Now when I map it. It does not show any data but it works when the data is static.

here is my code

` <DropdownTrigger class={'btn btn-primary'}> ACTION

                    </DropdownTrigger>
                        <DropdownMenu class="dropdown-menu-right">
                            {this.renderDropdownAction(this.props.seller.sellerRegistrationStatusList)}
                        </DropdownMenu>
                </Dropdown>`

`renderDropdownAction(sellerList) { if(sellerList){ console.log(sellerList); console.log("ssssssssssssssssssssssssss"); return sellerList.map((statusObj)=>{ return (

  • {statusObj.id}
  •         );
            })
        }else{
            return (
                <li>
                    <a class="menu-item" >
                        Not working
                    </a>
            </li>
        );
        }       

    }`

    Fauntleroy commented 7 years ago

    What is DropdownMenu? Do you have a complete example of this code, including the imports?

    thebedroomprogrammer commented 7 years ago

    It was my fault. Wrote some bad code. Thanks for replying.