-
Notifications
You must be signed in to change notification settings - Fork 90
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove keyevent form peerDependencies
- Loading branch information
Showing
4 changed files
with
35 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,48 +21,21 @@ | |
| 0.57.0 - 0.58.6 | yarn add [email protected] | | ||
| +0.59.0 | yarn add react-native-otp-inputs | | ||
|
||
### Android additional steps | ||
|
||
Android setup requires [react-native-keyevent](https://github.com/kevinejohn/react-native-keyevent) package to work properly. | ||
|
||
1. If you are using react-native < 0.60.0 then [follow these steps](https://github.com/kevinejohn/react-native-keyevent#linking-android) | ||
1. If you are using react-native >= 0.60.0 then add this to your dependencies in `react-native.config.js` | ||
|
||
```javascript | ||
// react-native.config.js | ||
module.exports = { | ||
dependencies: { | ||
'react-native-keyevent': { | ||
platforms: { | ||
ios: null, | ||
}, | ||
}, | ||
}, | ||
}; | ||
``` | ||
|
||
3. Add `react-native-keyevent` to your dependencies with | ||
|
||
```bash | ||
yarn add react-native-keyevent | ||
``` | ||
|
||
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) | ||
|
||
### [Migration to v4](./docs/Migration.md) | ||
|
||
## Basic usage | ||
|
||
```js | ||
import React, { Component } from 'react'; | ||
import { View } from 'react-native'; | ||
import OtpInputs from 'react-native-otp-inputs'; | ||
import React, { Component } from "react"; | ||
import { View } from "react-native"; | ||
import OtpInputs from "react-native-otp-inputs"; | ||
|
||
export default class App extends Component { | ||
render() { | ||
return ( | ||
<View style={styles.container}> | ||
<OtpInputs handleChange={code => console.log(code)} numberOfInputs={6} /> | ||
<OtpInputs | ||
handleChange={code => console.log(code)} | ||
numberOfInputs={6} | ||
/> | ||
</View> | ||
); | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters