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

Mount component inside mounted component? #5

Open
fallenpeace opened this issue Feb 8, 2016 · 3 comments
Open

Mount component inside mounted component? #5

fallenpeace opened this issue Feb 8, 2016 · 3 comments

Comments

@fallenpeace
Copy link

Goals: Mount DashboardAccount inside DashboardLayout, and mount DashboardEdit inside DashboardAccount

What I've tried

FlowRouter.route('/dashboard/account/edit', {
  name: 'dashboard.account.edit',
    action () {
      mount(DashboardLayout, {
         content: () => (<DashboardAccount />)
      });
      mount(DashboardAccount, {
        content: () => (<DashboardEdit />)
      });
    }
  });

ps. using the mantra spec.

@fallenpeace
Copy link
Author

Got something working with

FlowRouter.route('/dashboard/account/edit', {
  name: 'dashboard.account.edit',
    action () {
      mount(DashboardLayout, {
         content: () => (<DashboardAccount content={ () => (<DashboardEdit/>) }   />)
      });
    }
  });

Is this the recommended way of approaching this? or what is the correct way to approach this?

@arunoda
Copy link
Contributor

arunoda commented Feb 9, 2016

@fallenpeace Yeah. This seems like the way it's working now.
We may need to work on something simple.
May be, it's some more docs.

@Incisive
Copy link

Hi @fallenpeace - I've have components in props working this way:

authenticatedRoutes.route('/account/profile', {
  name: 'account.profile',
  action() {
    mount(MainLayout, {
      yield: <Account yield={<ProfileSettings/>} />
    });
  }
});

Hope this helps!

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

3 participants