This repo contains a series of branches that iterate on different approaches to rendering Flatlist - primarily to determine what approach performs the best. The example is a list of 1000 items which have a toggle button to select them. The profiler was used to determine the effects of the different implementations on performance.
main
contains the end resultbaseline
is the starting point - no optimizationscontext-based
uses React Context to manage selected ids statememoized
uses React.memo to optimize re-renders in flatlist rowscontext-selectors
uses zustand to manage selected ids state and memoized selectors to optimize re-renders in flatlist rowsrelative-context-selectors
also uses zustand, but componentizes it instead of reading from a global store