From d48d323013a4151a7b08b94fe384218cc2254353 Mon Sep 17 00:00:00 2001 From: "a.chernyavenko" Date: Tue, 28 Nov 2017 17:16:25 +0200 Subject: [PATCH] Docs: Add example to Modal documentation --- docs/modal.md | 64 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) diff --git a/docs/modal.md b/docs/modal.md index 673fb545932f04..86d6058baeb04f 100644 --- a/docs/modal.md +++ b/docs/modal.md @@ -7,6 +7,70 @@ permalink: docs/modal.html next: navigatorios previous: maskedviewios --- + +Minimal modal example: + +``` +import React, { Component } from 'react'; +import { Text, View, Button, Modal, StyleSheet } from 'react-native'; + +export default class MyComponent extends Component { + state = { + modalVisible: false, + }; + + openModal() { + this.setState({modalVisible:true}); + } + + closeModal() { + this.setState({modalVisible:false}); + } + + render() { + return ( + + this.closeModal()} + > + + + This is content inside of modal component + + + + +