Cómo usar complementos dependientes de jQuery en create-react-app
Quiero usar bootstrap y otros complementos de jQuery (datepicker, carrusel, ...) en mi aplicación React que usacreate-react-app
.
Así es como importo jQuery y bootstrap:
import React, { Component } from 'react';
import 'bootstrap/dist/css/bootstrap.min.css';
import $ from 'jquery';
window.jQuery = window.$ = $;
import 'bootstrap/dist/js/bootstrap.min';
Y me sale el siguiente error:
./src/App.js
Line 5: Import in body of module; reorder to top import/first
Search for the keywords to learn more about each error.
Tenga en cuenta que no quiero usarreact-bootstrap
paquete.