Accounts.ui.config: 不能多次设置 `passwordSignupFields`

Accounts.ui.config: Can't set `passwordSignupFields` more than once

在我的一个反应组件中,我有这个

<a href={'/application/' + username +'/' +appid}>My Application</a>

当我单击那个 link 时,我收到 javascript 错误 Accounts.ui.config: Can't set 'passwordSignupFields' more than once

但是,当我通过将 url 粘贴到浏览器地址栏中直接转到 url http://192.168.0.110:3000/application/john/X93ajdsfj 时,页面加载没有错误。我只在通过单击锚标记加载页面时出现错误。

我怀疑当我点击 link 时,我可能没有进行完整的 HTTP 页面重新加载,而只重新加载了部分内容,而这个 javascript 在我的 [=15] 中找到=] 再次被解雇:

  // This code is executed on the client only
  Accounts.ui.config({
  passwordSignupFields: "USERNAME_ONLY"
  });

我对流星完全陌生。避免此问题的最佳方法是什么?

我将代码从 React 组件中移出并放入流星项目的主 .jsx 文件中,并用 Meteor.isClient if 语句将其包装起来,如下所示:

if(Meteor.isClient)
{
  // This code is executed on the client only
  Accounts.ui.config({
  passwordSignupFields: "USERNAME_ONLY"
  });
}