react-native APIs
- View
- StyleSheet
- Text
- Platform
- TouchableOpacity
- ScrollView
- Image
- ViewStyle
- Dimensions
- StatusBar
- TextInput
- FlatList
- SafeAreaView
- TextStyle
- ActivityIndicator
- Alert
- StyleProp
- Animated
- Linking
- TouchableWithoutFeedback
- Button
- NativeModules
- KeyboardAvoidingView
- TextInputProps
- ViewProps
- Keyboard
- Easing
- ImageBackground
- TextProps
- LayoutChangeEvent
- NativeSyntheticEvent
- NativeEventEmitter
- Switch
- AppRegistry
- ImageStyle
- ImageSourcePropType
- TouchableOpacityProps
- Modal
- AppState
- RefreshControl
- TouchableHighlight
- BackHandler
- useWindowDimensions
- GestureResponderEvent
- AppStateStatus
- PixelRatio
- useColorScheme
- SectionList
- Pressable
- AsyncStorage
- UIManager
- I18nManager
- ImageProps
- LogBox
- FlatListProps
- LayoutRectangle
- findNodeHandle
- EmitterSubscription
- requireNativeComponent
- PermissionsAndroid
- InteractionManager
- ScrollViewProps
- TextInputFocusEventData
- Share
- ColorSchemeName
- ScaledSize
- Clipboard
- Insets
- NativeScrollEvent
- ListRenderItem
- LayoutAnimation
- TouchableNativeFeedback
- PanResponder
- SectionListData
- ListRenderItemInfo
- AccessibilityRole
- AccessibilityInfo
- ImageURISource
- ViewToken
- SectionListProps
- DeviceEventEmitter
- KeyboardEvent
- ActionSheetIOS
- processColor
- YellowBox
- DevSettings
- Slider
- ViewabilityConfig
- AccessibilityState
- EventSubscription
- Permission
- TextInputSelectionChangeEventData
- EasingFunction
- TouchableHighlightProps
- TextInputSubmitEditingEventData
- TextInputChangeEventData
- Appearance
- KeyboardTypeOptions
- AccessibilityEvent
- NativeScrollPoint
- ActionSheetIOSOptions
- HostComponent
- PlatformOSType
- ITheme
- IThemeColors
- IThemeFonts
- IThemeLayout
- IThemeUtils
- ViewPropTypes
- SectionListRenderItem
- NativeAppEventEmitter
- Picker
- VirtualizedList
- SectionListRenderItemInfo
- TextInputKeyPressEventData
- ShareAction
- ImageErrorEventData
- ProgressViewIOS
- ProgressBarAndroid
- RotateXTransform
- RotateYTransform
- PerpectiveTransform
- RotateTransform
- RotateZTransform
- ScaleTransform
- ScaleXTransform
- ScaleYTransform
- TranslateXTransform
- TranslateYTransform
- SkewXTransform
- SkewYTransform
- TransformsStyle
- NativeModulesStatic
- CheckBox
Other Related APIs
react-native#ShareAction TypeScript Examples
The following examples show how to use
react-native#ShareAction.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: index.tsx From lets-fork-native with MIT License | 5 votes |
// Initially shown while waiting for users to join party
// But can also be accessed through Menu for additional
// users to join after party has started
export default function Share(props: Props): React.ReactElement {
const [loading, setLoading] = React.useState(false)
const { party, ws } = props
const headerHeight = useHeaderHeight()
const viewHeight = env.ADS ? height - headerHeight - 50 : height - headerHeight
const handlePress = (): void => {
Alert.alert(
'',
'No matches will be shown until another user joins your party',
[
{
text: 'OK',
onPress: (): void => {
if (ws) {
ws.send(JSON.stringify({ type: 'start-swiping' }))
setLoading(true)
}
},
},
],
{ cancelable: true },
)
}
if (loading) {
return (
<View
style={{
...styles.container,
height: viewHeight,
}}
>
<ActivityIndicator size="large" />
</View>
)
}
return (
<View
style={{
...styles.container,
height: viewHeight,
}}
>
<Text style={styles.text}>Share this code with friends to have them join your party.</Text>
<Text style={styles.code}>{party.id}</Text>
<QRCode
size={200}
// value={`http://192.168.178.76:8003/party/${party.id}`}
value={`https://letsfork.app/party/${party.id}`}
/>
{
party.status === 'waiting'
&& <Button color="purple" size="lg" onPress={(): void => handlePress()}>START SWIPING</Button>
}
<TouchableOpacity
accessibilityRole="button"
onPress={(): Promise<ShareAction> => RNShare.share(
{ message: `Join my party on Let's Fork by clicking this link:\nhttps://letsfork.app/party/${party.id}\n\nor by opening the app and entering the code ${party.id}` },
)}
>
{Platform.OS === 'ios' ? (
<Ionicons name="ios-share-outline" size={32} />
) : (
<MaterialIcons name="share" size={32} />
)}
</TouchableOpacity>
</View>
)
}