Import the store in every component VS import once and pass data through props #2268
Unanswered
ozoono
asked this question in
Help and Questions
Replies: 1 comment
-
Have you found it answer, I have the same question in my mind. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
HI, i have a doubt about what would be the best way to use a pinia store in my app.
Let's Imagine i have several stores, and one the them (the main store) holds an object with a big amount of different values. Every component in the app will need a few of them.
I can't think about two different ways to do it:
import the store in the main component and pass needed data to each child component using props (or use provide/inject)
or
use the store in every component importing the "big" object (and avoiding props) , although the components only needs a small part of it
I don't know if import the store so many times could affect performance, so what do you think would be the best approach?
regards
Beta Was this translation helpful? Give feedback.
All reactions