Я пытаюсь использовать login-google-login, найденный в npm site, но я столкнулся с некоторыми проблемами. ОшибкаИнвариантное нарушение: проблема использования для библиотеки npm
bundle.js:3104 Warning: React.createElement: type should not be null, undefined, boolean, or number. It should be a string (for DOM elements) or a ReactClass (for composite components). Check the render method ofLogin.
и
bundle.js:3104 Warning: React.createElement: type should not be null, undefined, boolean, or number. It should be a string (for DOM elements) or a ReactClass (for composite components). Check the render method ofLogin
Это может быть потому, что из-за проблемы использования. Возможно, я тоже неправильно импортировал. Любая помощь очень ценится.
var React = require('react')
var GoogleLogin = require('react-google-login')
var Login = React.createClass({
responseGoogle(e){
console.log("response",e)
},
render:function(){
return <div>
<GoogleLogin
clientId="xxxxxxxxxxx-yyyyyyyyyy.apps.googleusercontent.com"
buttonText="Login"
callback={this.responseGoogle} />
</div>
},
});
module.exports = Login;
~
Это наиболее вероятно, вызывая нежелательные функции или класса. Я использовал требование, и я не знаком с импортом. Любые предложения или заметки о правильном способе определения правильных синтаксисов в будущем также приветствуются.
Вы спасатель жизни! Это потрясающе. Спасибо –