When using Toolpad Core's Crud, the required DataSource must be defined as a client component. However, with tRPC, the client can only be used inside a component. Does this mean that tRPC cannot be used as a DataSource for Toolpad Core's Crud, since DataSource must be defined at the top level (not inside a component)? #5104
kryushiki
started this conversation in
Discussions
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
When using Toolpad Core's Crud, the required DataSource must be defined as a client component. However, with tRPC, the client can only be used inside a component. Does this mean that tRPC cannot be used as a DataSource for Toolpad Core's Crud, since DataSource must be defined at the top level (not inside a component)?
page.tsx
https://mui.com/toolpad/core/react-crud/#data-sources
The following tRPC code only works on the server, so it will cause an error if used on the client.
data.ts
thank you
Beta Was this translation helpful? Give feedback.
All reactions