Я продвинулся в обучении, найденном здесь:
https://www.youtube.com/watch?v=6vcIW0CO07k
Но я застрял на отметке 19 минут.
По сути, учебное пособие заключается в создании приложения Instant Messenger с использованием React и Chatkit.
Я получаю сообщение «Не удалось скомпилировать», используя следующий код, который представляет собой файл с именем Chatscreen.js:
import React from 'react'
import ChatKit from '@pusher/chatkit'
class ChatScreen extends React.Component {
componentDidMount () {
const chatManager = new Chatkit.ChatManager({
instanceLocator: 'v1:us1:5802c885-ab9d-409b-aa98-5dbcfc69efd1',
userId: this.props.currentUsername,
tokenProvider: new ChatKit.tokenProvider({
url: 'http://localhost:3001/authenticate'
})
})
chatManager
.connect()
.then(currentUser => console.log('currentUser', currentUser))
.catch(error => console.error(error))
}
render() {
return (
<div>
<h1>Chat</h1>
<p>Hello, {this.props.currentUsername}</p>
</div>
)
}
}
export default ChatScreen
Сообщение об ошибке гласит:
Failed to compile.
./src/ChatScreen.js
Line 6: 'Chatkit' is not defined no-undef
Вот ссылка на мой репозиторий github.Почему я получаю эту ошибку?
https://github.com/rezzworks/REACT-SLACK-CLONE