E
E
E2015-08-06 15:09:10
JavaScript
E, 2015-08-06 15:09:10

Is it possible to hide/unload a React component in Meteor under certain conditions?

I use: meteor, react, accounts-password, kadira:flow-router-ssr, kadira:react-layout.
There are routes and React components, of course, all this stuff is loaded in the body of the page.
The router looks something like this:

FlowRouter.route('/admin-login', {
  action: function () {
    ReactLayout.render(AdminLogin);
  }
});
FlowRouter.route('/admin-panel', {
  action: function () {
    ReactLayout.render(AdminPanel);
  }
});

The essence of the question: is there a way to hide the component while the user is not logged in so that it would not be loaded in the body, well, not at all camille so that the admin component would be loaded for all users. And yes, all this goodness is rendered on the server side, kadira:flow-router-ssr is responsible for this business.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
E, 2015-08-06
@aylo

Reading the Meteor documentation again, more no than yes. This is what Meteor's first principle says.

Data on the wire. Meteor doesn't send HTML over the network. The server sends data and lets the client render it.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question