I have the following scenario. I have a list of categories. Whenever I click one, I make an ajax request to get its subcategories. After that, I should render another list with the subcategories, which then, of course, can have subcategories.
This could led up to something like this:
Electronics -> Computers -> Notebooks -> HP -> Accessories.
The only way I can imagine of doing this, is creating a component for the list of items, and creating a new instance whenever I click one category and have subcategories.
Is there any other way of doing it? if not, how could I create a new instance of a component everytime after I make a request?
Well use render function and recursion. basically you have component that renders list which list items can be clicked. so render recursively the same component which component structure is based on nested object.
Hi,
I have the following scenario. I have a list of categories. Whenever I click one, I make an ajax request to get its subcategories. After that, I should render another list with the subcategories, which then, of course, can have subcategories.
This could led up to something like this:
Electronics -> Computers -> Notebooks -> HP -> Accessories.
The only way I can imagine of doing this, is creating a component for the list of items, and creating a new instance whenever I click one category and have subcategories.
Is there any other way of doing it? if not, how could I create a new instance of a component everytime after I make a request?
Thanks!