I have a json of 10000 records which I need to show in a Flatlist.I am using a virtualized list which is working fine.Now I have certain filters which on click should filter out the json and re render the list with the new data.I am simply filtering out the data.
const filters = foo1;
const largeList = [{ id:1, foo:'foo1',bar:10 },{id:2, foo:'foo1',bar:20} ...]
const filteredList = largeList.filter(l=>l.foo === filters && l.bar > 10);
The filters are dynamic and this lags my application since it puts pressure in the UI thread.I have used InteractionManager.runafterinteractions() but that is not working in this situation. How do I do such expensive operations in the app without blocking the UI thread ?