Skip to content

Instantly share code, notes, and snippets.

View Karthik-B-06's full-sized avatar
๐Ÿ™
trying to create and solve problems with code

Karthik Karthik-B-06

๐Ÿ™
trying to create and solve problems with code
View GitHub Profile
import { NativeStackScreenProps } from "@react-navigation/native-stack";
import React, { useEffect, useRef } from "react";
import { useForm } from "react-hook-form";
import { Dimensions, Pressable, StyleSheet, Text, TextInput } from "react-native";
import Animated, { Easing, FadeIn, FadeInDown, interpolate, runOnJS, useAnimatedStyle, useSharedValue, withTiming } from "react-native-reanimated";
import { SafeAreaView } from "react-native-safe-area-context";
import Svg, { Path } from "react-native-svg";
import tw from "twrnc";
import { AuthStackParamList } from "../../../App";
import useToastStore, { defaultToastValues } from "../../store/useToastStore";
import { NativeStackScreenProps } from "@react-navigation/native-stack";
import React, { useEffect, useRef } from "react";
import { useForm } from "react-hook-form";
import { Dimensions, Pressable, StyleSheet, Text, TextInput, View } from "react-native";
import Animated, { Easing, FadeIn, FadeInDown, interpolate, runOnJS, useAnimatedStyle, useSharedValue, withTiming } from "react-native-reanimated";
import { SafeAreaView } from "react-native-safe-area-context";
import Svg, { Path } from "react-native-svg";
import tw from "twrnc";
import { AuthStackParamList } from "../../../App";
import useToastStore, { defaultToastValues } from "../../store/useToastStore";
import { NativeStackScreenProps } from "@react-navigation/native-stack";
import React from "react";
import { Dimensions, Image, Pressable, StyleSheet, Text } from "react-native";
import Animated, { FadeIn, FadeInDown } from "react-native-reanimated";
import { SafeAreaView } from "react-native-safe-area-context";
import { AuthStackParamList } from "../../../App";
type OnboardingProps = NativeStackScreenProps<AuthStackParamList, "Onboarding">;
const OnboardingScreen: React.FC<OnboardingProps> = (props) => {
import * as React from "react";
import { View, Text, Button } from "react-native";
import { NavigationContainer, useNavigation } from "@react-navigation/native";
import { createNativeStackNavigator, NativeStackScreenProps } from "@react-navigation/native-stack";
export type AuthStackParamList = {
Onboarding: undefined;
Login: undefined;
Register: undefined;
};
@Karthik-B-06
Karthik-B-06 / App.tsx
Created January 14, 2022 07:59
Stack Navigation in React Native with Typescript
import * as React from "react";
import { View, Text, Button } from "react-native";
import { NavigationContainer, useNavigation } from "@react-navigation/native";
import { createNativeStackNavigator, NativeStackScreenProps } from "@react-navigation/native-stack";
export type RootStackParamList = {
Home: undefined;
Settings: undefined;
Profile: undefined;
};
import React from 'react';
import {
GestureResponderEvent,
InteractionManager,
Pressable,
StyleSheet,
Text,
View,
ViewProps,
} from 'react-native';
import React from 'react';
import { Image, StyleSheet } from 'react-native';
import { SafeAreaView } from 'react-native-safe-area-context';
import BackArrowIcon from 'src/assets/svg/common/BackArrowIcon';
import PageHeader from 'src/components/organisms/PageHeader';
import { tailwind } from 'tailwind';
const PageHeaderScreen = () => {
return (
<SafeAreaView style={tailwind('bg-white flex-1')}>
import React from 'react';
import { GestureResponderEvent, Pressable, StyleSheet, Text, View, ViewProps } from 'react-native';
import { headingTextStyle } from 'src/styles/textStyles';
import { tailwind } from 'tailwind';
type PageHeaderProps = {
leftNode?: JSX.Element;
rightNode?: JSX.Element;
headerText?: string;
handleOnPressLeftNode?: (event: GestureResponderEvent) => void;
<Pressable
style={({ pressed }) => [
tailwind('flex mx-4 py-4 border-gray-200'),
pressed ? tailwind('bg-gray-200 px-2 mx-2 rounded-lg') : {},
]}
>
<View>
<Text style={[bodyTextStyle.FS18_MEDIUM, tailwind('text-black text-center')]}>
Pressable with a cool rounded feedback
</Text>