Closed karanasthana closed 4 years ago
Unable to Add ActionButton Items dynamically.
I have the following setup --
<ActionButton> <ActionButton.item name={constant_btn1} /> <ActionButton.item name={constant_btn2} /> </ActionButton>
I want to add dynamic buttons to this list. (The list is received from backend)
I have created a function that returns me views of these buttons.
getDynamicBtns() { dynamicButtonsList.map(item, key) => {( return <ActionButton.item name={item.btnName} />; )}; }
and I have used it in this way inside my render() function -->
<ActionButton> <ActionButton.item name={constant_btn1} /> <ActionButton.item name={constant_btn2} /> {this.getDynamicBtns} </ActionButton>
So this is rendering my constant buttons, but not the dynamic buttons.
The dynamic buttons were being added as an array of buttons instead of adding buttons one by one. Rest, worked fine.
Unable to Add ActionButton Items dynamically.
I have the following setup --
I want to add dynamic buttons to this list. (The list is received from backend)
I have created a function that returns me views of these buttons.
and I have used it in this way inside my render() function -->
So this is rendering my constant buttons, but not the dynamic buttons.