Skip to content

Commit 58e47bd

Browse files
committed
1.0.1
1 parent 3fd2850 commit 58e47bd

File tree

7 files changed

+32
-15
lines changed

7 files changed

+32
-15
lines changed

Example/ExampleMain.js

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,28 +12,25 @@ class ExampleMain extends Component {
1212
this.state = {
1313
selectedIndex: 0,
1414
badgesStyleIndex: 0,
15-
customStyleIndex: 0,
15+
customStyleIndex: 0
1616
}
1717
}
1818

1919
handleSingleIndexSelect = (index) => {
2020
this.setState({
21-
...this.state,
22-
selectedIndex: index,
21+
selectedIndex: index
2322
});
2423
}
2524

2625
handleBadgesSelect = (index) => {
2726
this.setState({
28-
...this.state,
29-
badgesStyleIndex: index,
27+
badgesStyleIndex: index
3028
});
3129
}
3230

3331
handleCustomIndexSelect = (index) => {
3432
this.setState({
35-
...this.state,
36-
customStyleIndex: index,
33+
customStyleIndex: index
3734
});
3835
}
3936

Example/README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,19 @@ Updating the `react-native-scripts` dependency of your app should be as simple a
3434

3535
Upgrading to a new version of React Native requires updating the `react-native`, `react`, and `expo` package versions, and setting the correct `sdkVersion` in `app.json`. See the [versioning guide](https://github.com/react-community/create-react-native-app/blob/master/VERSIONS.md) for up-to-date information about package version compatibility.
3636

37+
# Example
38+
To run this example
39+
1. create a symlink package from the root directory, as shown below:
40+
```shell
41+
npm link
42+
```
43+
2. switch to the example folder and then run `yarn start` command, which would launch the app on simulator using the [expo](https://expo.io/) app
44+
45+
```shell
46+
cd Example
47+
yarn start
48+
```
49+
3750
## Available Scripts
3851

3952
If Yarn was installed when the project was initialized, then dependencies will have been installed via Yarn, and you should probably use it to run these commands as well. Unlike dependency installation, command running syntax is identical for Yarn and NPM at the time of this writing.

Example/package-lock.json

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Example/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,6 @@
2222
"expo": "^27.0.1",
2323
"react": "16.3.1",
2424
"react-native": "~0.55.2",
25-
"react-native-segmented-control-ui": "1.0.0"
25+
"react-native-segmented-control-ui": "file:.."
2626
}
2727
}

README.md

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,12 @@
1010
A react native component similar to iOS SegmentedControl, Primarily built to support both IOS and Android.
1111

1212
# Example
13-
To run example
13+
To run the example
14+
1. create a symlink package from the root directory, as shown below:
15+
```shell
16+
npm link
17+
```
18+
2. switch to the example folder and then run `yarn start` command, which would launch the app on simulator using the [expo](https://expo.io/) app
1419

1520
```shell
1621
cd Example
@@ -25,19 +30,18 @@ yarn start
2530
```javascript
2631
import SegmentedControlTab from 'react-native-segmented-control-ui'
2732

28-
class ConsumerComponent extends Component {
33+
const ConsumerComponent extends Component {
2934

3035
constructor(){
3136
super()
3237
this.state = {
33-
selectedIndex: 0,
38+
selectedIndex: 0
3439
};
3540
}
3641

3742
handleIndexChange = (index) => {
3843
this.setState({
39-
...this.state,
40-
selectedIndex: index,
44+
selectedIndex: index
4145
});
4246
}
4347

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-native-segmented-control-ui",
3-
"version": "1.0.0",
3+
"version": "1.0.1",
44
"description": "SegmentedControl using react-native,support android and ios",
55
"main": "index.js",
66
"scripts": {

0 commit comments

Comments
 (0)