Skip to content

Commit

Permalink
Use modal portal
Browse files Browse the repository at this point in the history
  • Loading branch information
jacklam718 committed Dec 18, 2020
1 parent b9f9488 commit 49737c8
Show file tree
Hide file tree
Showing 15 changed files with 100 additions and 36 deletions.
38 changes: 18 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Just click on ⭐️ button 😘
</span>

## BREAKING CHANGE
A lot of backward incompatible changes in `v0.20.0`. Please, Read the Docs before upgrading to `v0.20.0`
A lot of backward incompatible changes in `v0.22.0`. Please, Read the Docs before upgrading to `v0.22.0`

## Installation

Expand Down Expand Up @@ -54,8 +54,24 @@ yarn add react-native-modals
* BackdropProps

## Examples
[Example](https://github.com/jacklam718/react-native-modals/blob/master/modals-example/App.js)
[Example](https://github.com/jacklam718/react-native-modals/blob/master/example/src/DemoScreen.js)

## Setup - this is essential step
The Component can not be used until `ModalPortal` is mounted.
You should register in your app root. For example:
```jsx
import { ModalPortal } from 'react-native-modals';
import { Provider } from 'react-redux';

const Root = () => {
return (
<Provider store={store}>
<App />
<ModalPortal />
</Provider>
);
}
```

## Basic Usage
```jsx
Expand Down Expand Up @@ -83,24 +99,6 @@ import { Button } from 'react-native'
```

## Usage - Imperative APIs
The api can not be used until `ModalPortal` is mounted.
You should register in your app root. For example:
```jsx
import { ModalPortal } from 'react-native-modals';
import { Provider } from 'react-redux';

const Root = () => {
return (
<React.Fragment>
<Provider store={store}>
<App />
<ModalPortal />
</Provider>
</React.Fragment>
)
}
```

show
```jsx
import { ModalPortal } from 'react-native-modals';
Expand Down
1 change: 1 addition & 0 deletions dist/BottomModal.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions dist/Modal.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/ModalPortal.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 49737c8

Please sign in to comment.