Fork me on GitHub
Roman Liutikov20:03:51

@amarjeet looks you are performing http req in :will-mount which is executed only once, when component is mounting into the DOM

Roman Liutikov20:03:21

also generally it’s not a good idea to perform IO within components or their lifecycle methods


my use-case is that I want to fetch books for certain category from my db (server). this should happen, when a user selects a category on the web page - this should trigger an http call to fetch data, sending selected category as parameter


Is there any other way to make it happen?


and after user selects the category - the results should be shown right after

Roman Liutikov20:03:26

do it in :on-click handler for example


hmm, that might be a good idea


let me try this


@roman01la yes, this is a better way. thanks 🙂