Skip to content

Commit

Permalink
Updated example for react-native 0.25+
Browse files Browse the repository at this point in the history
  • Loading branch information
jeanregisser committed May 12, 2016
1 parent 2447ab5 commit 566d058
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
9 changes: 5 additions & 4 deletions Example/app.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
'use strict';

var React = require('react-native');
var React = require('react');
var ReactNative = require('react-native');
var Slider = require('../src/Slider');
var {
AppRegistry,
Expand All @@ -9,7 +10,7 @@ var {
ScrollView,
View,
SliderIOS,
} = React;
} = ReactNative;

var DEFAULT_VALUE = 0.2;

Expand Down Expand Up @@ -37,7 +38,7 @@ var SliderContainer = React.createClass({
_renderChildren() {
return React.Children.map(this.props.children, (child) => {
if (child.type === Slider
|| child.type === React.Slider) {
|| child.type === ReactNative.Slider) {
var value = this.state.value;
return React.cloneElement(child, {
value: value,
Expand All @@ -61,7 +62,7 @@ var SliderExample = React.createClass({
return (
<ScrollView contentContainerStyle={styles.container}>
<SliderContainer caption='<React.Slider/>'>
<React.Slider />
<ReactNative.Slider />
</SliderContainer>
<SliderContainer caption='<Slider/> with default style'>
<Slider />
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@ npm i --save react-native-slider
```jsx
'use strict';

var React = require('react-native');
var React = require('react');
var Slider = require('react-native-slider');
var {
AppRegistry,
StyleSheet,
View,
Text,
} = React;
} = require('react-native');

var SliderExample = React.createClass({
getInitialState() {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"eslint": "^0.23.0",
"eslint-plugin-react": "^2.5.2",
"react": "^0.14.8",
"react-native": "^0.24.1",
"react-native": "^0.25.1",
"rimraf": "^2.5.2"
}
}

0 comments on commit 566d058

Please sign in to comment.