15 ways to make a slow React app: Put all state in the root Don’t cache,...
15 ways to make a slow React app:
Put all state in the root
Don’t cache, refetch
Pass needless props
Change state constantly
Request more data than you need
Drill props (instead of composing children)
Render 1000s of elements
Use heavy, non-native inputs
1/x…
#react
Bloat the bundle via monolithic libraries
Overuse context
Use named imports on 3rd party libs (may load the entire lib)
Put everything in 1 component
Don’t memo
Pass funcs that aren’t wrapped in useCallback to expensive children
Don’t lazy load - publish a monolithic bundle