Привет, я просто хочу получить ajax-запрос, но проблема в том, что jquery не определен в React. Реактивная версия 14.0
Сообщение об ошибке
Uncaught ReferenceError: $ is not defined
У меня есть два файла:
index.js
import React from 'react';
import { render } from 'react-dom';
import App from './containers/App';
const root = document.getElementById('root');
render(
<App source='https://api.github.com/users/octocat/gists' />,
root
);
app.js
import React, { Component } from 'react';
export default class App extends Component {
componentDidMount() {
const { source } = this.props;
console.log($); // throws error
}
render() {
return (
<h1>Hey there.</h1>
);
}
}