Skip to content
Discussion options

You must be logged in to vote

Depends on whether you want to run the code on the client or server! (Pretty much the same question you have with any event handler in Next.js App Router.)

If you're doing something like a realtime subscription to track cursor positions on some kind of collaboration app, that's a pretty clear use case for running the code on the client.

If you're making a request for data and you need to do a lot of data manipulation to get it in a renderable form, that's possibly an argument for running the code on the server.

Then there are a lot of in-between cases, it depends on exactly what you're trying to do and what performance trade-offs you need to make. (Client code runs on the user's browser a…

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@LORE-D-NATO
Comment options

@charislam
Comment options

@denisfilab
Comment options

Answer selected by LORE-D-NATO
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants