N
Nuxt5mo ago
nikneym

Passing props vs `useNuxtData`

Hi, when do you prefer useNuxtData over passing props and vice versa? For example I have a ServiceEntity component that's been used for each row in a table. I'm curious if it'd be better to pass entities prop to each (like <ServiceEntity :entities="entities" />) or just directly using useNuxtData("service.entities") inside of the component.
1 Reply
nikneym
nikneymOP5mo ago
what are the upsides of provide/inject compared to useNuxtData? I believe useNuxtData does a hash map match, not sure how provide/inject resolves stuff I'll probably not going to use pinia since that way I simply replicate what nuxt already do
Want results from more Discord servers?
Add your server