Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9258275
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T12:21:24+00:00 2026-06-18T12:21:24+00:00

I’m using Meteor and having an issue where my content is being re-rendered when

  • 0

I’m using Meteor and having an issue where my content is being re-rendered when I don’t want it to.

I have my main content wrapped in a currentUser if statement which I feel is fairly standard.

{{#if currentUser}}
  {{> content}}
{{/if}}

The problem with this is my content template is being re-rendered when I update my user object. Is there any way around this? I don’t reference users anywhere inside the content template.

Thank you!

Here’s a sample app to replicate my problem:

HTML

<head>
  <title>Render Test</title>
</head>

<body>
  {{loginButtons}}

  {{> userUpdate}}

  {{#if currentUser}}
    {{> content}}
  {{/if}}
</body>

<template name="userUpdate">
  <p>
    <input id="updateUser" type="button" value="Update User Value" />
    User last update: <span id="lastUpdated">{{lastUpdated}}</span>
  </p>
</template>

<template name="content">
  <p>Render count: <span id="renderCount"></span></p>
</template>

JavaScript

if (Meteor.isClient) {
  Meteor.startup(function() {
    Session.set("contentRenderedCount", 0);
  });

  Template.content.rendered = function() {
    var renderCount = Session.get("contentRenderedCount") + 1;
    Session.set("contentRenderedCount", renderCount);
    document.getElementById("renderCount").innerText = renderCount;
  };

  Template.userUpdate.events = {
    "click #updateUser": function() {
      Meteor.users.update({_id: Meteor.userId()}, {$set: {lastActive: new Date()}});
    }
  };

  Template.userUpdate.lastUpdated = function() {
    return Meteor.user().lastActive;
  };

}

if (Meteor.isServer) {
  Meteor.users.allow({
    'update': function () {
      return true; 
    }
  });
}

Update:
I should’ve explained this example a little. After creating a user, clicking the Update User Value button, causes the render count to increment. This is because it’s wrapped in a {{#if currentUser}}. If this is if is removed, you’ll notice the render count remains at 1.

Also, you’ll need to add the accounts-ui and accounts-password packages to your project.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T12:21:26+00:00Added an answer on June 18, 2026 at 12:21 pm

    Meteor will re-render any template containing reactive variables that are altered. In your case the {{currentUser}} is Meteor.user() which is an object containing the user’s data. When you update the users profile, the object changes and it tells meteor to re-calculate everything reactive involving the object.

    We could alter the reactivity a bit so it only reacts to changes in whether the user logs in/out and not anything within the object itself:

    Meteor.autorun(function() {
        Session.set("meteor_loggedin",!!Meteor.user());
    });
    
    Handlebars.registerHelper('session',function(input){
        return Session.get(input);
    });
    

    Your html

    {{#if session "meteor_loggedin"}}
        {{> content}}
    {{/if}}    
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using JSon response to parse title,date content and thumbnail images and place
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a French site that I want to parse, but am running into
We're building an app, our first using Rails 3, and we're having to build
I don't have much knowledge about the IPv6 protocol, so sorry if the question
I have thousands of HTML files to process using Groovy/Java and I need to
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
That's pretty much it. I'm using Nokogiri to scrape a web page what has

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.