I am developing an app in React.
Until now I have just included
<script src='//unpkg.com/react@15/dist/react.min.js'>
<script src='//unpkg.com/react-dom@15/dist/react-dom.min.js'>
<script src='//unpkg.com/babel-standalone@6/babel.min.js'>
and then I neither had to use
import React from 'react';
import ReactDOM from 'react-dom';
since everything was loaded nor had to compile anything since babel compiled it in real-time.
However, when I want to include third-party libraries installed with npm, it seems I have to use import. For instance, if I install react-dates
with npm-install react-dates --save
and want to include it with
import { DateRangePicker, SingleDatePicker, DayPickerRangeController } from 'react-dates';
I get the error
Uncaught ReferenceError: require is not defined
I guess it's because I don't use RequireJS, Webpack, Gulp or anything.
What is the preferred way to be able to include components while developing, so I don't have to compile my code everytime I did a small change?
via Jamgreen
No comments:
Post a Comment