Javascript React应用程序中未触发按钮onClick事件

Javascript React应用程序中未触发按钮onClick事件,javascript,node.js,reactjs,browserify,Javascript,Node.js,Reactjs,Browserify,我有以下申请代码: 'use strict'; //function to handle gapi initialization var init = function() { //load plus api gapi.client.load('plus' , 'v1' , function() { gapi.isReady = true; }); } window.init = init; var React = require('React'), aapi

我有以下申请代码:

'use strict';

//function to handle gapi initialization
var init = function() {
   //load plus api
  gapi.client.load('plus' , 'v1' , function() {
    gapi.isReady = true;
  });
}

window.init = init;

var React = require('React'),
    aapi = require('./components/alonso-api'),
    BlogList = require('./components/blog-list'),
    ActivityBox = require('./components/activity-box'),
    GoogleSignin = require('./components/google-signin');    

if (!window.React) {
  window.React = React;
}

React.render(<BlogList data={aapi.blogs.read()} /> , document.getElementById('blog-list'));

React.render(<ActivityBox data={aapi.blogs.read({
  offset : 0,
  limit : 3
})} /> , document.getElementById('activity-box'));

React.render(<GoogleSignin clientId='client-id' scope='https://www.googleapis.com/auth/userinfo.email'/> , document.getElementById('google-signin'));

我在没有Browserify的情况下运行了相同的代码,并且按钮处理程序得到了正确处理,因此我不确定我缺少了什么

控制台中有错误吗?请尝试在其中添加e.preventDefault。有时,这会对类似这样的奇怪事情有所帮助。我尝试添加e.preventDefault,但运气不好,控制台中没有错误消息,只是收到一些警告消息,因为我渲染的数组没有唯一的密钥属性,但我不太确定这是否有关联。我只是简单地摆弄了一下你的谷歌登录组件,效果很好。也许可以尝试删除其他组件,以及gapi init,只留下GoogleSignin。也许有什么东西干扰了那个部件?并尝试通过React tools Chrome查看您的按钮,看看您的活动是否已附加。
var React = require('react'),
    window = window || {},
    gapi = window.gapi || {};

var GoogleSignin = React.createClass({
  handleClick : function(e) {
    console.log('click!');
  },
  render : function() {
    return (
      <div className="googleSignin">
        <button className="btn btn-default" onClick={this.handleClick}><i className="fa fa-google-plus"></i>  Sign in</button>
      </div>
    );
  }
});

module.exports = GoogleSignin;