Closed MaxLeiter closed 1 year ago
We did not add this yet because of multiple reasons:
"use client"
in it so it didn't had any affect. Will check if this is supported alreadybeforeSend
."use client"
in the first line (but yes, we could manually add that after compiling in the first line)At the time created the package, the app directory didn't support importing packages that had "use client" in it so it didn't had any affect. Will check if this is supported already
Confirmed this is supported
It's not possible to pass functions from a server component to our component then. This is needed for beforeSend.
What if the user doesn’t use beforeSend
? If we add use client, the user can use <Analytics />
as is, and if they need beforeSend
they can make their own wrapper component
The bundler did not add "use client" in the first line (but yes, we could manually add that after compiling in the first line)
It'd be best for the bundler to support it, but yeah any hack like this could work
This should remove the need for consumers to wrap vercel/analytics in its own client component