Skip to content

Releases: Qeepsake/react-native-subset-navigator

1.2.0 Able to pass props to individual screens

27 Apr 09:32
Compare
Choose a tag to compare
  • Updated example and README e2de31d
  • Passprops for individual screens bf8ceb2

v1.1.0...v1.2.0

Can now pass props to the next screen/ component with the push method and access it with the passProps prop:

const OnboardingOne = ({ navigator, passProps }) => {
    return (
        <>
            <TouchableOpacity onPress={() => {
                navigator.push("OnboardingTwo", {
                setPageNumber: passProps.setPageNumber,
                })}
            }>
            </TouchableOpacity>
        </>
    );
}

1.1.0 Added animations hooks for transitions between screens

05 Mar 18:29
Compare
Choose a tag to compare

It can be used as shown:

import { Animated, ... } from 'react-native' //<-- import Animated from react-native
import {
  useFadeInAnimation,
  useSlideRightAnimation,
} from 'react-native-subset-navigator' //<-- import the animations you want


const OnboardingOne = ({ navigator, passProps }) => {
    // Use animations like so
    const animatedOpacity = useFadeInAnimation()
    const slideRightAnimation = useSlideRightAnimation()

    return (
    // Use Animated
    <Animated.View style={[animatedOpacity, slideRightAnimation]}>
        <TouchableOpacity onPress={() => navigator.push("OnboardingTwo")}>
            <View />
        </TouchableOpacity>
        <TouchableOpacity onPress={() => navigator.pop()}>
            <View />
        </TouchableOpacity>
        <TouchableOpacity onPress={() => passProps.setPageNumber(2)}>
            <View />
        </TouchableOpacity>
    </Animated.View>
    );
}

1.0.4 Allow passing of props to screens

01 Mar 08:35
Compare
Choose a tag to compare

v1.0.3...v1.0.4

1.0.3 Export Navigator class

26 Feb 10:47
Compare
Choose a tag to compare

1.0.2 Updated react version

26 Feb 08:17
Compare
Choose a tag to compare

v1.0.1...v1.0.2

1.0.1 Added tsconfig.json

17 Feb 09:31
Compare
Choose a tag to compare

1.0.0 Initial Commit

17 Feb 07:36
Compare
Choose a tag to compare

Usage:

  1. Create the Subset Navigator
    createSubsetNavigator(nameOfFirstOverlay, Overlays)
import { createSubsetNavigator } from "react-native-subset-navigator";

const OnboardingOverlay = () => {
        const OverlaySubset = createSubsetNavigator("OnboardingOne", {
          "OnboardingOne": OnboardingOne,
          "OnboardingTwo": OnboardingTwo,
          "OnboardingThree": OnboardingThree,
        })

    return (
        <View style={{}}> // <-- modal common container
            <OverlaySubset />
        </View> 
    );
}
  1. Create the components to take in a 'navigator' prop and use the push and pop methods to navigate
const OnboardingOne = ({ navigator }) => {
    return (
        <>
            <TouchableOpacity onPress={() => navigator.push("OnboardingTwo")}>
                <View />
            <TouchableOpacity>
            <TouchableOpacity onPress={() => navigator.pop()}>
                <View />
            <TouchableOpacity>
        </>
    );
}

064a4fd...v1.0.0