tRPC singleton vs context #16
Replies: 1 comment 1 reply
-
Thank you very much! There might have been an error on my end in the current implementation - thanks for bringing up the question. I'm currently working on an extended version of this repo, and have been trying to keep this version up-to-date with the latest changes probably a bit too hastily. I changed/reverted this back to this I'd like to keep this setup as close to the official examples as possible, so the very short answer to your question is because it's in the official tRPC/Tanstack Start example from their repo. It's using I had been digging through the tRPC documentation some time ago finding a way to implement this, but I didn't came to a solution close to the one from the example tbh. If you have any suggestions/improvements, please let me know! |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi there!
Let me start by saying that this repo and template are incredible! Well done and thank you so much for putting them together!
I have been looking into setting up something similar myself and I was debating between using the tRPC context provider vs using it as a singleton and i noticed here you went with the "singleton" approach vs the context one.
Just wanted to ask why, as the tRPC docs recommend the use of the context in ssr frameworks! Many thanks!
Beta Was this translation helpful? Give feedback.
All reactions