Previously the limit of the dropdown was set to 3 which was the size of the first object in the array that was in the state. So irrespective of the size of the coming element. the size was preset to 3.
after I discovered that I'd replaced the object which had the most number of subCat to the first one in the array(rearranging the data in the temporary state/Temporary). Then all the elements started showing up.
Then I noticed that all the other elements show undefined at the bottom of their dropdown after all of their content in the dropdown.
Please help me resolve this issue.



