Skip to content

Conversation

@DominikSerafin
Copy link
Contributor

It was confusing for me in the beginning where and when to pass props as initial data so I think it might be confusing for others too.

It was confusing for me in the beginning where and when to pass props as initial data so I think it might be confusing for others too.
@chrisvfritz
Copy link
Contributor

That actually wasn't quite what we meant, so it's good you're bringing this up. 😄 I just added a couple examples and would love to hear your thoughts.

@chrisvfritz chrisvfritz closed this Nov 4, 2016
@DominikSerafin
Copy link
Contributor Author

@chrisvfritz I wasn't sure 100% that's the correct way to do it (I've even asked a question about it on SO) So I was kinda hoping for two things with this pull request:

  1. Either my solution will be correct one and the pull will be merged;
  2. Or someone like you will correct me and shows the good way to do it and include it in the docs (and it happened so thank you!)

And that method of directly passing the props to the data is 💯. I don't have much feedback about it because I think that's perfect (the method and how it's described in docs now).

@chrisvfritz
Copy link
Contributor

Fantastic! Thanks for helping make the docs a little better for everyone that comes after you. 👏🏻

@samlaf
Copy link

samlaf commented Aug 21, 2021

@chrisvfritz How can we deal with the case when the data we are passing down to the child component is gotten from a database asynchronously during the create() phase of the parent, and is still not available during the create() phase of the child?

@sonnt189
Copy link

@samlaf well, this case you can use watcher with immedieate:true flag to get props to assign new state in child components

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

Successfully merging this pull request may close these issues.

4 participants