@3beeepb/react-native-prompt 中文文档教程
react-native-prompt
React Native 的跨平台(iOS / Android)提示组件。
Add it to your project
运行
npm install @3beeepb/react-native-prompt --save
导入库
import Prompt from '@3beeepb/react-native-prompt';
像这样使用它:
<Prompt titleText={'What is your name?'} onCancel={() => console.log('cancel')} onDone={() => console.log('done')} > <TextInput /> </>
Properties
Name | Description | Type |
---|---|---|
titleText | Title text | string |
cancelText | Cancel button text | string |
doneText | Done button text | string |
titleTextStyle | Title text styles | StyleSheet |
cancelTextStyle | Cancel button text styles | StyleSheet |
doneTextStyle | Done button text style | StyleSheet |
onCancel | Will be called when a user press left (Cancel) button. | () => void |
onDone | Will be called when a user press right (Done/OK) button. | () => void |
Contribution
请确保在通过运行 npm test。
react-native-prompt
A cross-platform (iOS / Android) prompt component for React Native.
Add it to your project
Run
npm install @3beeepb/react-native-prompt --save
Import the library
import Prompt from '@3beeepb/react-native-prompt';
Just use it like this:
<Prompt titleText={'What is your name?'} onCancel={() => console.log('cancel')} onDone={() => console.log('done')} > <TextInput /> </>
Properties
Name | Description | Type |
---|---|---|
titleText | Title text | string |
cancelText | Cancel button text | string |
doneText | Done button text | string |
titleTextStyle | Title text styles | StyleSheet |
cancelTextStyle | Cancel button text styles | StyleSheet |
doneTextStyle | Done button text style | StyleSheet |
onCancel | Will be called when a user press left (Cancel) button. | () => void |
onDone | Will be called when a user press right (Done/OK) button. | () => void |
Contribution
Please make sure to run the tests before proposing a PR by running npm test
.