I decided to use react-scrollbar to customize the scrollbars on the site. In the manual on the use of nodovskiy import module
var ScrollArea = require('react-scrollbar'); var App = React.createClass({ render() { return ( <ScrollArea speed={0.8} className="area" contentClassName="content" horizontal={false} > <div>Some long content.</div> </ScrollArea> ); } }); the build is successful, however when I run the application I get an error
React.createElement: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: object I use ES6 import
import ScrollArea from 'react-scrollbar/src/js/ScrollAreaWithoutCss' and getting another error
SyntaxError: Unexpected token import for some reason, swears at the first line of the module file
import ScrollArea from './ScrollArea.jsx'; export default ScrollArea; Where do I make a mistake?
Config with babel
module: { preloaders:[{ test: /\.(js|jsx)$/, loaders: ['eslint'] }], loaders: [{ test: /\.(js|jsx)$/, loaders: ['babel'], exclude: [ /(node_modules|bower_components)/ ] }] ... .babelrc
{ "presets": ["es2015", "stage-0", "react"], "plugins": ['transform-runtime', 'transform-decorators-legacy'] }