🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Sign inDemoInstall
Socket

react-native-web-hover

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-native-web-hover - npm Package Compare versions

Comparing version

to
0.2.8

2

package.json
{
"name": "react-native-web-hover",
"version": "0.2.7",
"version": "0.2.8",
"description": "Some enhanced elements for react-native-web to support hover on the web",

@@ -5,0 +5,0 @@ "main": "lib/commonjs/index",

@@ -21,7 +21,44 @@ # react-native-web-hover

## Usage
We recommend the "Pressable" component. You can see all the examples here:
```
import { Hoverable, Pressable, } from 'react-native-web-hover'
// The Pressable, you can still provide normal styles or children without functions!
<Pressable
style={({ hovered, focused, pressed }) => [
styles.buttonRoot,
hovered && styles.buttonHovered,
focused && styles.buttonFocused,
pressed && styles.buttonPressed
]}
>
{({ hovered, focused, pressed }) => (
<View style={styles.buttonInner}>
<Text style={styles.buttonLabel}>
{label}
</Text>
</View>
)}
</Pressable>
// The Hoverable
<Hoverable>
{({ hovered }) => (
<Button
title="legacy button"
onPress={() => {}}
color={hovered ? "black" : "grey"}
/>
)}
</Hoverable>
```
We recommend the "Pressable" component. You can see examples here:
https://codesandbox.io/s/young-surf-bbmzz?file=/src/App.tsx
If you want to update the hover inside FlatList, ScrollViews or VirtualizedList when the user scrolls, don't forget to import these views from this library.
### Nested Scrollables
If you want to update the hover inside **NESTED** FlatList, ScrollViews or VirtualizedList when the user scrolls, don't forget to import these views from this library.
import { Hoverable, Pressable, ScrollView, FlatList, VirtualizedList } from 'react-native-web-hover'

@@ -28,0 +65,0 @@