It looks like you're new here. If you want to get involved, click one of these buttons!
const [tickerList, setTickerList] = useState([]);
{tickerList.map(function(name, index){
return(
<div key={index}>
<button
data-kite="aaaaaaaaaaaaa"
data-exchange="NSE"
data-tradingsymbol={name}
data-transaction_type="SELL"
data-quantity="1"
data-order_type="LIMIT"
data-price="100">Buy {name}
</button>
</div>
);
})}
<button
data-kite="aaaaaaaaaaaa"
data-exchange="NSE"
data-tradingsymbol="ACC"
data-transaction_type="SELL"
data-quantity="1"
data-order_type="LIMIT"
data-price="100">Buy ACC
</button>
tickerList
state correctly? Also, print to console and check again in method1 as well, iftickerlist
is updated properly.For us to debug further on this, you need to paste here complete code.
https://ide.codingblocks.com/s/449940
after clicking showlist button
after clicking showlist button once again
buttons rendered by map function are irresponsive
but the button rendered separately works fine.
also, when i click showlist, state of tickerlist is empty, but still the buttons get rendered , how this is happening.
https://ide.codingblocks.com/s/449945
when list of stocks will be fetched from backend,
buttons corresponding to each stock should be created
We went through your above-linked code and console output screenshots. It looks like an issue with your
tickerList.map
iteration and button attributes assignment logic. As all publisher buttons are rendered properly when individually assigned with correct value attribute i.e yourmethod2
. It has nothing to do with kite publisher.finally working as expected