File tree Expand file tree Collapse file tree 12 files changed +57
-57
lines changed Expand file tree Collapse file tree 12 files changed +57
-57
lines changed Original file line number Diff line number Diff line change 1111 semi:
1212 - 2
1313 - always
14+ react/no-did-update-set-state:
15+ - 0
1416 react/sort-comp:
1517 - 2
1618 - order
Original file line number Diff line number Diff line change 99< body >
1010 < div id ="app "> </ div >
1111
12- < script src ="https://cdnjs.cloudflare.com/ajax/libs/react/0.13.3/react.js "> </ script >
12+ < script src ="https://fb.me/react-0.14.3.js "> </ script >
13+ < script src ="https://fb.me/react-dom-0.14.3.js "> </ script >
1314 < script src ="https://cdnjs.cloudflare.com/ajax/libs/babel-core/5.8.25/browser-polyfill.js "> </ script >
1415 < script src ="./build/example.js "> </ script >
1516</ body >
Original file line number Diff line number Diff line change 1- import React from 'react' ;
1+ import ReactDOM from 'react-dom ' ;
22import App from 'App' ;
33
4- React . render (
4+ ReactDOM . render (
55 < App /> ,
66 document . getElementById ( 'app' )
77) ;
Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ module.exports = function(config) {
66
77 files : [
88 'node_modules/react/dist/react.js' ,
9+ 'node_modules/react-dom/dist/react-dom.js' ,
910 'node_modules/lodash/index.js' ,
1011 'node_modules/babelify/polyfill.js' ,
1112 'src/**/*.js' ,
Original file line number Diff line number Diff line change 2727 "browserify" : " ^11.0.0" ,
2828 "browserify-shim" : " ^3.8.10" ,
2929 "del" : " ^1.2.0" ,
30- "eslint" : " ^1.0.0 " ,
31- "eslint-config-airbnb" : " 0 .0.7 " ,
32- "eslint-plugin-react" : " ^3.1 .0" ,
30+ "eslint" : " ^1.10.2 " ,
31+ "eslint-config-airbnb" : " ^1 .0.2 " ,
32+ "eslint-plugin-react" : " ^3.10 .0" ,
3333 "gulp" : " ^3.9.0" ,
3434 "gulp-babel" : " ^5.2.1" ,
3535 "gulp-bump" : " ^1.0.0" ,
3636 "gulp-concat" : " ^2.6.0" ,
3737 "gulp-connect" : " ^2.2.0" ,
38- "gulp-eslint" : " ^0.15.0 " ,
38+ "gulp-eslint" : " ^1.1.1 " ,
3939 "gulp-git" : " ^1.4.0" ,
4040 "gulp-minify-css" : " ^1.2.0" ,
4141 "gulp-postcss" : " ^6.0.0" ,
5555 "karma-phantomjs2-launcher" : " ^0.3.2" ,
5656 "lodash" : " ^3.10.0" ,
5757 "phantomjs" : " ^1.9.17" ,
58+ "react" : " ^0.14.0" ,
59+ "react-dom" : " ^0.14.0" ,
5860 "run-sequence" : " ^1.1.4" ,
5961 "semver" : " ^5.0.3" ,
6062 "vinyl-buffer" : " ^1.0.0" ,
6163 "vinyl-source-stream" : " ^1.1.0" ,
6264 "watchify" : " ^3.3.0"
6365 },
6466 "peerDependencies" : {
65- "react" : " ^0.13.3 "
67+ "react" : " ^0.14.0 "
6668 },
6769 "browserify" : {
6870 "transform" : [
6971 " browserify-shim"
7072 ]
7173 },
7274 "browserify-shim" : {
73- "react" : " global:React"
75+ "react" : " global:React" ,
76+ "react-dom" : " global:ReactDOM"
7477 },
7578 "scripts" : {
7679 "build" : " gulp build" ,
Original file line number Diff line number Diff line change @@ -8,9 +8,6 @@ class Slider extends React.Component {
88 // Initial state
99 this . state = { } ;
1010
11- // Enable touch
12- React . initializeTouchEvents ( true ) ;
13-
1411 // Auto-bind
1512 autobind ( [
1613 'handleClick' ,
@@ -35,8 +32,8 @@ class Slider extends React.Component {
3532
3633 // Getters / Setters
3734 get document ( ) {
38- const element = React . findDOMNode ( this ) ;
39- const document = element . ownerDocument ;
35+ const { slider } = this . refs ;
36+ const document = slider . ownerDocument ;
4037
4138 return document ;
4239 }
@@ -111,7 +108,10 @@ class Slider extends React.Component {
111108 const style = this . state . style || { } ;
112109
113110 return (
114- < span className = { classNames . sliderContainer } style = { style } >
111+ < span
112+ className = { classNames . sliderContainer }
113+ ref = "slider"
114+ style = { style } >
115115 < span className = { classNames . labelValue } >
116116 < span className = { classNames . labelContainer } >
117117 { this . props . value }
Original file line number Diff line number Diff line change @@ -8,9 +8,6 @@ class Track extends React.Component {
88 // Initial state
99 this . state = { } ;
1010
11- // Enable touch
12- React . initializeTouchEvents ( true ) ;
13-
1411 // Auto-bind
1512 autobind ( [
1613 'handleMouseDown' ,
@@ -29,7 +26,7 @@ class Track extends React.Component {
2926
3027 // Getters / Setters
3128 get clientRect ( ) {
32- const track = React . findDOMNode ( this ) ;
29+ const { track } = this . refs ;
3330 const clientRect = track . getClientRects ( ) [ 0 ] ;
3431
3532 return clientRect ;
@@ -75,9 +72,10 @@ class Track extends React.Component {
7572
7673 return (
7774 < div
75+ className = { classNames . trackContainer }
7876 onMouseDown = { this . handleMouseDown }
7977 onTouchStart = { this . handleTouchStart }
80- className = { classNames . trackContainer } >
78+ ref = "track" >
8179 < div
8280 style = { activeTrackStyle }
8381 className = { classNames . trackActive } >
Original file line number Diff line number Diff line change 1- import { objectOf } from './util' ;
1+ import { isNumber , objectOf } from './util' ;
22
33function numberPredicate ( value ) {
44 return typeof value === 'number' ;
@@ -19,8 +19,8 @@ export function maxMinValuePropType(props) {
1919 return new Error ( '`value` or `defaultValue` must be a number' ) ;
2020 }
2121
22- if ( ! value &&
23- ! defaultValue &&
22+ if ( ! isNumber ( value ) &&
23+ ! isNumber ( defaultValue ) &&
2424 ! objectOf ( values , numberPredicate ) &&
2525 ! objectOf ( defaultValues , numberPredicate ) ) {
2626 return new Error ( '`values` or `defaultValues` must be an object of numbers' ) ;
Original file line number Diff line number Diff line change 11import gulp from 'gulp' ;
2+ import runSequence from 'run-sequence' ;
23
3- gulp . task ( 'run' , [
4- 'build' ,
5- 'watch' ,
6- 'connect' ,
7- ] ) ;
4+ gulp . task ( 'run' , ( callback ) => {
5+ runSequence (
6+ 'build' ,
7+ [ 'watch' , 'connect' ] ,
8+ callback
9+ ) ;
10+ } ) ;
Original file line number Diff line number Diff line change @@ -10,10 +10,10 @@ gulp.task('watch', [
1010] ) ;
1111
1212gulp . task ( 'watch:script' , ( ) => {
13- compileScript ( true , config . watch . script . example ) ;
1413 compileScript ( true , config . watch . script . build , ( ) => {
1514 gulp . start ( 'lint:script' ) ;
1615 } ) ;
16+ compileScript ( true , config . watch . script . example ) ;
1717} ) ;
1818
1919gulp . task ( 'watch:style' , ( ) => {
You can’t perform that action at this time.
0 commit comments