Why is the Bluesky agent stored in state instead of a ref? #3498
Unanswered
VariabileAleatoria
asked this question in
Clarifications and "Why?"
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hey everyone!
Apologies if this isn’t the right place to ask—just a curious developer here.
I’m building an app where a TypeScript class handles API calls and is passed down to components via the Context API, similar to how Bluesky does it. I noticed that Bluesky stores its agent in a state variable (via useReducer) rather than using a ref. Since the agent shouldn’t trigger re-renders, wouldn’t a ref be a better fit?
Is there a specific reason for this approach, or am I overthinking it? Would love to hear your insights!
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions