next.js icon indicating copy to clipboard operation
next.js copied to clipboard

Update 12-third-party-libraries.mdx

Open allanchau opened this issue 8 months ago • 2 comments

What?

This PR aims to provide some clarification on what the dataLayer prop does.

Why?

https://nextjs.org/docs/app/building-your-application/optimizing/third-party-libraries#options

Data layer array to instantiate the container with. Defaults to an empty array.

There seems to be 2 problems with this description when viewing the code https://github.com/vercel/next.js/blob/canary/packages/third-parties/src/google/gtm.tsx#L40-L45:

  1. There is no default.
  2. The dataLayer prop should be an object that is then pushed to the dataLayer array.

allanchau avatar Jun 24 '24 06:06 allanchau