Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Warning: withDefaults() is unnecessary when using defineProps() with destructuring #207

Open
nexoscreator opened this issue Dec 1, 2024 · 0 comments

Comments

@nexoscreator
Copy link

I am encountering a warning when using the @nuxtjs/google-adsense module in my Nuxt 3 project. The warning indicates that withDefaults() is unnecessary when defineProps() is used with destructuring. Here are the details:

Warning Message:

 WARN  [@vue/compiler-sfc] withDefaults() is unnecessary when using destructure with defineProps().
Reactive destructure will be disabled when using withDefaults().
Prefer using destructure default values, e.g., const { foo = 1 } = defineProps(...).

node_modules/@nuxtjs/google-adsense/dist/runtime/components/Adsbygoogle.vue
11 |    hideUnfilled,
12 |    includeQuery,
13 |  } = withDefaults(defineProps<{
   |      ^^^^^^^^^^^^
14 |    adClient?: string
15 |    adSlot?: string | null

Environment:

Nuxt Version: ^3.14.1592
Module Version: "^3.0.0",
Node Version: v20.15.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant