Error when I try to load ScrollBarWrapper
Hello, I want try your module and I've error :
build.js:15397 Warning: React.createElement: type should not be null, undefined, boolean, or number. It should be a string (for DOM elements) or a ReactClass (for composite components). Check the render method ofProfil.
build.js:14954 Uncaught Invariant Violation: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: undefined. Check the render method ofProfil.
My code source :
import React from 'react';
import {
Grid,
Cell
} from "react-mdl";
var ScrollbarWrapper = require('react-scrollbar').ScrollbarWrapper;
var ProfilHeader = require('./children/profilHeader/ProfilHeader.js');
var ProfilExperiences = require('./children/profilExperiences/ProfilExperiences.js');
var ProfilEducations = require('./children/profilEducations/ProfilEducations.js');
var ProfilHobbies = require('./children/profilHobbies/ProfilHobbies.js');
var ProfilSkills = require('./children/profilSkills/ProfilSkills.js');
var ProfilLanguages = require('./children/profilLanguages/ProfilLanguages.js');
import './styles/less/Profil.less';
var Profil = React.createClass({
render: function() {
return (
<ScrollbarWrapper>
<Grid className="searchList" style={{ paddingRight: '15px'}}>
<Cell col={12} tablet={12} phone={12}>
<div className="profil">
<ProfilHeader />
<ProfilExperiences />
<ProfilEducations />
<ProfilHobbies />
<ProfilSkills />
<ProfilLanguages />
</div>
</Cell>
</Grid>
</ScrollbarWrapper>
);
}
});
module.exports = Profil;
Any idea ?
it's ok, I've changed import by :
import ScrollbarWrapper from 'react-scrollbar';
hmm, with this syntax, it is the module react-scrollbar that is considered, how is added .ScrollBarWrapper variable with this syntax like
var ScrollbarWrapper = require('react-scrollbar').ScrollbarWrapper;
Failed to compile.
Error in ./~/react-scrollbars/lib/components/scrollbar-wrapper.js
Module not found: 'react/addons' in /Users/dji/t/my-app/node_modules/react-scrollbars/lib/components
@ ./~/react-scrollbars/lib/components/scrollbar-wrapper.js 2:12-35
For ES6 it would be import { ScrollbarWrapper } from 'react-scrollbar'