Demo showing how each tab has its own history stack. Navigating between each tab remembers the correct back and forward views that were visited.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { View, Text, StyleSheet } from 'react-native'; | |
import React from 'react'; | |
import { UserState } from '../providers/RevenueCatProvider'; | |
interface UserProps { | |
user: UserState; | |
} | |
// Display the user state based on entitlements (previous purchases) | |
const User = ({ user }: UserProps) => { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { View, Text, ScrollView, StyleSheet, TouchableOpacity, Button } from 'react-native'; | |
import React, { useLayoutEffect } from 'react'; | |
import { useRevenueCat } from '../providers/RevenueCatProvider'; | |
import { useNavigation } from '@react-navigation/native'; | |
import { PurchasesPackage } from 'react-native-purchases'; | |
import User from '../components/User'; | |
const Home = () => { | |
const navigation = useNavigation(); | |
const { user, packages, purchasePackage, restorePermissions } = useRevenueCat(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { createContext, useContext, useEffect, useState } from 'react'; | |
import { Platform } from 'react-native'; | |
import Purchases, { LOG_LEVEL, PurchasesPackage } from 'react-native-purchases'; | |
import { CustomerInfo } from 'react-native-purchases'; | |
// Use your RevenueCat API keys | |
const APIKeys = { | |
apple: '', | |
google: '', | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"sync.gist": "cb84c4f0f3f3c9c96bc8f62c67eb09f5" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign-in, then Tabs: Nightly | |
--------------------------- | |
Demo showing how each tab has its own history stack. Navigating between each tab remembers the correct back and forward views that were visited. | |
Forked from [Ionic](http://codepen.io/ionic/)'s Pen [Ionic Sign-in, then Tabs: 0.9.27](http://codepen.io/ionic/pen/kcjLb/). | |
A [Pen](http://codepen.io/RodrigoIbarraSanchez/pen/jbGRNV) by [Rodrigo](http://codepen.io/RodrigoIbarraSanchez) on [CodePen](http://codepen.io/). | |
[License](http://codepen.io/RodrigoIbarraSanchez/pen/jbGRNV/license). |