Skip to content

Commit 8de9325

Browse files
kantormDamian Sznajder
authored andcommitted
Remove keyevent form peerDependencies
1 parent 6b820cb commit 8de9325

File tree

4 files changed

+35
-67
lines changed

4 files changed

+35
-67
lines changed

README.md

Lines changed: 7 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -21,48 +21,21 @@
2121
| 0.57.0 - 0.58.6 | yarn add react-native-otp-inputs@3.2.2 |
2222
| +0.59.0 | yarn add react-native-otp-inputs |
2323

24-
### Android additional steps
25-
26-
Android setup requires [react-native-keyevent](https://github.com/kevinejohn/react-native-keyevent) package to work properly.
27-
28-
1. If you are using react-native < 0.60.0 then [follow these steps](https://github.com/kevinejohn/react-native-keyevent#linking-android)
29-
1. If you are using react-native >= 0.60.0 then add this to your dependencies in `react-native.config.js`
30-
31-
```javascript
32-
// react-native.config.js
33-
module.exports = {
34-
dependencies: {
35-
'react-native-keyevent': {
36-
platforms: {
37-
ios: null,
38-
},
39-
},
40-
},
41-
};
42-
```
43-
44-
3. Add `react-native-keyevent` to your dependencies with
45-
46-
```bash
47-
yarn add react-native-keyevent
48-
```
49-
50-
4. Then follow configuration for Android [here](https://github.com/kevinejohn/react-native-keyevent#configuration) (If you have problems, check [Example App](./Example/android/app/src/main/java/com/example/MainActivity.java) configuration)
51-
52-
### [Migration to v4](./docs/Migration.md)
53-
5424
## Basic usage
5525

5626
```js
57-
import React, { Component } from 'react';
58-
import { View } from 'react-native';
59-
import OtpInputs from 'react-native-otp-inputs';
27+
import React, { Component } from "react";
28+
import { View } from "react-native";
29+
import OtpInputs from "react-native-otp-inputs";
6030

6131
export default class App extends Component {
6232
render() {
6333
return (
6434
<View style={styles.container}>
65-
<OtpInputs handleChange={code => console.log(code)} numberOfInputs={6} />
35+
<OtpInputs
36+
handleChange={code => console.log(code)}
37+
numberOfInputs={6}
38+
/>
6639
</View>
6740
);
6841
}

docs/API.md

Lines changed: 27 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
11
# API
22

3-
| Method | Type | Required | Default | Description |
4-
| --------------------- | -------------- | ----------- | --------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
5-
| autoCapitalize | string | false | 'none' | |
6-
| autofillFromClipboard | boolean | false | true | You can set it to `false` if want to switch off autofill from clipboard. |
7-
| clearTextOnFocus | boolean | false | false | |
8-
| defaultValue | string | false | | Sets default value for otp inputs |
9-
| handleChange | function | true | console.log | Returns otp code. |
10-
| keyboardType | string | true | 'phone-pad' | Do not use `numeric` `number-pad` or `decimal-pad` for android as it [won't work on android correctly](https://github.com/dsznajder/react-native-otp-inputs/issues/213) |
11-
| numberOfInputs | number | true (1..6) | 4 | Inputs count to render. |
12-
| secureTextEntry | boolean | false | false | |
13-
| selectTextOnFocus | boolean | false | true [iOS Only](./src/OtpInput.tsx#L56) | |
14-
| testIDPrefix | string | false | otpInput-\${inputIndex} | Prefix for testID. |
15-
| isRTL | boolean | false | false | Preferably I18nManager.isRTL. |
16-
| placeholder | string | false | | Placeholder for the input boxes. |
17-
| style | style (object) | false | [default](./src/index.tsx#L275) | Applied to whole container. |
18-
| focusStyles | style (object) | false | [default](./src/index.tsx#L275) | Applied to the input on focus. |
19-
| inputStyles | style(object) | false | [default](./src/index.tsx#L275) | Applied to single input. |
20-
| inputContainerStyles | style (object) | false | [default](./src/index.tsx#L275) | Applied to each input container. |
21-
| ...restTextInputProps | | | | [TextInput](https://facebook.github.io/react-native/docs/textinput) |
3+
| Method | Type | Required | Default | Description |
4+
| --------------------- | -------------- | ----------- | --------------------------------------- | ------------------------------------------------------------------------ |
5+
| autoCapitalize | string | false | 'none' | |
6+
| autofillFromClipboard | boolean | false | true | You can set it to `false` if want to switch off autofill from clipboard. |
7+
| clearTextOnFocus | boolean | false | false | |
8+
| defaultValue | string | false | | Sets default value for otp inputs |
9+
| handleChange | function | true | console.log | Returns otp code. |
10+
| keyboardType | string | true | 'phone-pad' | |
11+
| numberOfInputs | number | true (1..6) | 4 | Inputs count to render. |
12+
| secureTextEntry | boolean | false | false | |
13+
| selectTextOnFocus | boolean | false | true [iOS Only](./src/OtpInput.tsx#L56) | |
14+
| testIDPrefix | string | false | otpInput-\${inputIndex} | Prefix for testID. |
15+
| isRTL | boolean | false | false | Preferably I18nManager.isRTL. |
16+
| placeholder | string | false | | Placeholder for the input boxes. |
17+
| style | style (object) | false | [default](./src/index.tsx#L275) | Applied to whole container. |
18+
| focusStyles | style (object) | false | [default](./src/index.tsx#L275) | Applied to the input on focus. |
19+
| inputStyles | style(object) | false | [default](./src/index.tsx#L275) | Applied to single input. |
20+
| inputContainerStyles | style (object) | false | [default](./src/index.tsx#L275) | Applied to each input container. |
21+
| ...restTextInputProps | | | | [TextInput](https://facebook.github.io/react-native/docs/textinput) |
2222

2323
# Methods
2424

@@ -32,9 +32,9 @@ Those can be called on ref:
3232
## Example
3333

3434
```js
35-
import React, { Component } from 'react';
36-
import { Button, View } from 'react-native';
37-
import OtpInputs from 'react-native-otp-inputs';
35+
import React, { Component } from "react";
36+
import { Button, View } from "react-native";
37+
import OtpInputs from "react-native-otp-inputs";
3838

3939
export default class App extends Component {
4040
otpRef = React.createRef();
@@ -52,7 +52,11 @@ export default class App extends Component {
5252
<View style={styles.container}>
5353
<Button title="Reset" onPress={this.resetOTP} />
5454
<Button title="Focus" onPress={this.focusOTP} />
55-
<OtpInputs ref={this.otpRef} handleChange={code => console.log(code)} numberOfInputs={6} />
55+
<OtpInputs
56+
ref={this.otpRef}
57+
handleChange={code => console.log(code)}
58+
numberOfInputs={6}
59+
/>
5660
</View>
5761
);
5862
}

package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,7 @@
3535
],
3636
"peerDependencies": {
3737
"react": "*",
38-
"react-native": ">= 0.57.0 < 1",
39-
"react-native-keyevent": "0.2.7"
38+
"react-native": ">= 0.57.0 < 1"
4039
},
4140
"jest": {
4241
"testEnvironment": "node",

yarn.lock

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6892,7 +6892,6 @@ npm@^6.13.4:
68926892
cmd-shim "^3.0.3"
68936893
columnify "~1.5.4"
68946894
config-chain "^1.1.12"
6895-
debuglog "*"
68966895
detect-indent "~5.0.0"
68976896
detect-newline "^2.1.0"
68986897
dezalgo "~1.0.3"
@@ -6907,7 +6906,6 @@ npm@^6.13.4:
69076906
has-unicode "~2.0.1"
69086907
hosted-git-info "^2.8.5"
69096908
iferr "^1.0.2"
6910-
imurmurhash "*"
69116909
infer-owner "^1.0.4"
69126910
inflight "~1.0.6"
69136911
inherits "^2.0.4"
@@ -6926,14 +6924,8 @@ npm@^6.13.4:
69266924
libnpx "^10.2.0"
69276925
lock-verify "^2.1.0"
69286926
lockfile "^1.0.4"
6929-
lodash._baseindexof "*"
69306927
lodash._baseuniq "~4.6.0"
6931-
lodash._bindcallback "*"
6932-
lodash._cacheindexof "*"
6933-
lodash._createcache "*"
6934-
lodash._getnative "*"
69356928
lodash.clonedeep "~4.5.0"
6936-
lodash.restparam "*"
69376929
lodash.union "~4.6.0"
69386930
lodash.uniq "~4.5.0"
69396931
lodash.without "~4.4.0"

0 commit comments

Comments
 (0)