react-native-use-modal-hooks
Advanced tools
Comparing version 1.2.0 to 1.3.0
{ | ||
"name": "react-native-use-modal-hooks", | ||
"description": "React hooks for displaying a modal window in React Native", | ||
"version": "1.2.0", | ||
"version": "1.3.0", | ||
"main": "dist/index.js", | ||
@@ -6,0 +6,0 @@ "types": "dist/index.d.ts", |
@@ -14,3 +14,3 @@ # react-native-use-modal-hooks | ||
## Demo | ||
![demo](https://user-images.githubusercontent.com/32378535/89108919-b28cf380-d477-11ea-8596-8b05f3988aa6.gif) | ||
![demo](https://user-images.githubusercontent.com/32378535/89127880-46b89280-d52c-11ea-92fb-52c650f6d1c3.gif) | ||
@@ -22,6 +22,27 @@ ## How to install | ||
- Use ModalProvider to provide modal context for your application: | ||
``` | ||
import React from 'react' | ||
import { NavigationContainer } from '@react-navigation/native'; | ||
import { ModalProvider } from "react-native-use-modal-hooks"; | ||
const App: React.FC = () => { | ||
return ( | ||
<ModalProvider> | ||
<NavigationContainer> | ||
{/* Screen configuration */} | ||
</NavigationContainer> | ||
</ModalProvider> | ||
) | ||
} | ||
export default App | ||
``` | ||
- Call useModal with the dialog component of your choice. | ||
``` | ||
import React from 'react' | ||
import { View, Text, StyleSheet, Modal, TouchableHighlight, Button } from 'react-native' | ||
import { useModal } from '../src'; | ||
import { useModal } from 'react-native-use-modal-hooks'; | ||
@@ -96,2 +117,2 @@ const styles = StyleSheet.create({ | ||
} | ||
``` | ||
``` |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
24244
116
0