先上代码:
import React from 'react';
import iScroll from 'iscroll/build/iscroll-probe';
import ReactIScroll from 'react-iscroll';
import PoverView from '../components/pointOverview.jsx';
import PointList from '../components/PointList.jsx';
class Points extends React.Component {
constructor(props){
super(props);
}
onScrollEnd(){}
render () {
return (
<ReactIScroll iscroll={iScroll} onScrollEnd={this.onScrollEnd}>
<div>
<PoverView></PoverView>
<PointList></PointList>
</div>
</ReactIScroll>
);
}
}
Points.defaultProps = {
options: {
mouseWheel: true,
scrollbars: true
}
}
export default Points;
现在遇到问题是
Warning: Failed propType: ReactIScroll: iScroll not passed to component props. Check the render method of `Points`.
Uncaught TypeError: iScroll is not a function
配置:
"devDependencies": {
"babel-core": "^6.1.2",
"babel-jest": "^5.3.0",
"babel-loader": "^6.1.0",
"babel-preset-es2015": "^6.1.2",
"babel-preset-react": "^6.1.2",
"css-loader": "^0.23.1",
"del": "^2.0.2",
"gulp": "^3.9.0",
"gulp-autoprefixer": "^3.1.0",
"gulp-concat": "^2.6.0",
"gulp-connect": "^2.2.0",
"gulp-livereload": "^3.8.1",
"gulp-load-plugins": "^1.1.0",
"gulp-size": "^2.0.0",
"gulp-stylus": "^2.1.0",
"gulp-uglify": "^1.4.2",
"gulp-util": "^3.0.7",
"gulp-watch": "^4.3.5",
"gulp-webpack": "^1.5.0",
"jest-cli": "^0.7.1",
"object-assign": "^4.0.1",
"orchestrator": "^0.3.7",
"react-addons-test-utils": "^0.14.2",
"style-loader": "^0.13.0",
"webpack": "^1.12.3"
},
"dependencies": {
"history": "^1.13.0",
"iscroll": "^5.1.3",
"react": "^0.14.2",
"react-dom": "^0.14.2",
"react-iscroll": "^1.0.0",
"react-router": "^1.0.0",
"react-weui": "^0.2.0",
"reflux": "^0.3.0",
"weui": "^0.4.0"
}
}
}
请大神指教!