TLDR Web Dev · ARTICLES & TUTORIALS

USE ASYNC LOCAL STORAGE TO PREVENT PROPS DRILLING IN NEXT.JS ROUTE HANDLERS

nico.fyi5 min read

Summary from the TLDR Web Dev newsletter

Async Local Storage acts like React Context but for Node.js, storing data accessible within the same execution context. It can be used to pass a user object through multiple functions easily. The code provided uses `userContext.run()` to wrap functions needing access.