studiointeract / accounts-material

Material UI – Accounts UI for React in Meteor 1.3
MIT License
13 stars 9 forks source link

Login form disappear on update #7

Open yanickrochon opened 8 years ago

yanickrochon commented 8 years ago

Using Meteor@1.4+, and std:accounts-material@1.1.0, have have this route set up

FlowRouter.route("/login", {
  action() {
    mount(LoginLayout, {
      loginForm: <Accounts.ui.LoginForm />
    });
  }
});

And whenever the URI changes (say adding #foo), the route's action gets executed again, but the loginForm is not rendered anymore.

fIa5h commented 8 years ago

+1

fIa5h commented 8 years ago

@yanickrochon what does your entire routes.jsx file look like? Is this happening when you're passing it to nested routes? If so, try re-rendering the form like so:

var authenitcatedRoutes = FlowRouter.group({prefix: "/app", name: "app"});

// handling /app
authenitcatedRoutes.route('/', {
    name: 'app',
    action: function() {
        mount(App, {
            content: () => (
                <Page userControls={< Accounts.ui.LoginForm />}/>
            )
        });
    }
});

// handling /app/anotherPage
authenitcatedRoutes.route('/anotherPage', {
    name: 'app.anotherPage',
    action: function() {
        mount(App, {
            content: () => (
                <AnotherPage userControls={< Accounts.ui.LoginForm />}/>
            )
        });
    }
});

Also, you have import React from 'react' in your routes.jsx and have npm installed react-dom?