react-native-use-modal-hooks
Advanced tools
Comparing version
{ | ||
"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 | ||
 | ||
 | ||
@@ -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
2.16%116
23.4%0
-100%