From ccc45b938145f494717b66f5e3f46ada5c1d86b4 Mon Sep 17 00:00:00 2001 From: Vojtech Novak Date: Sun, 17 Sep 2017 19:43:28 +0200 Subject: [PATCH] Update README.md --- README.md | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index fc89879..a00b442 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,15 @@ Installation ------------ ### Installation using RNPM -```rnpm install react-native-dialogs``` +1 . `yarn add react-native-dialogs` + +or + +`npm i react-native-dialogs --save` + + + +2 . `react-native link react-native-dialogs` In `android/app/build.gradle`, add a dependency to `':react-native-dialogs'` and URL of the Jitpack maven repository (to download the library https://github.com/afollestad/material-dialogs) : ``` @@ -71,21 +79,22 @@ Now you're finally ready to start using module in your React Native application. Usage ----- ```javascript -var DialogAndroid = require('react-native-dialogs'); +import DialogAndroid from 'react-native-dialogs'; -var options = { +let options = { title: 'Hello, World!', content: 'I\'m just simple Dialog', positiveText: 'OK', negativeText: 'Cancel' }; -var showDialog = function () { +let showDialog = function () { var dialog = new DialogAndroid(); dialog.set(options); dialog.show(); } ``` + Creation of a dialog works in 3 steps : 1. Create a new dialog using `new DialogAndroid()`. 2. Set some options using `dialog.set(options)`. `set` can be called multiple times, and options from multiple calls will be merged.