Skip to content

Instantly share code, notes, and snippets.

View rahgurung's full-sized avatar
💻
Working

Rahul Gurung rahgurung

💻
Working
View GitHub Profile
import 'react-native-gesture-handler';
import * as React from 'react';
import {Text, Button} from 'react-native';
import {NavigationContainer} from '@react-navigation/native';
import {createDrawerNavigator} from '@react-navigation/drawer';
// Our Screens
function Screen1({navigation}) {
return (
<>
import * as React from 'react';
import { Text } from 'react-native';
// Imports related to navigation
import {NavigationContainer} from '@react-navigation/native';
import {createDrawerNavigator} from '@react-navigation/drawer';
// Initialize the Drawer navigator
const Drawer = createDrawerNavigator();
import * as React from 'react';
import {Text} from 'react-native';
import {NavigationContainer} from '@react-navigation/native';
import {createBottomTabNavigator} from '@react-navigation/bottom-tabs';
// Our Tabs
function Tab1() {
return <Text>Tab 1</Text>;
}
import * as React from 'react';
import { Text } from 'react-native';
// Imports related to navigation
import {NavigationContainer} from '@react-navigation/native';
import { createBottomTabNavigator } from '@react-navigation/bottom-tabs';
// Initialize the Tab navigator
const Tab = createBottomTabNavigator();
import * as React from 'react';
import {Text, Button} from 'react-native';
import {NavigationContainer} from '@react-navigation/native';
import {createNativeStackNavigator} from '@react-navigation/native-stack';
// Our Screens
function Screen1({navigation}) {
return (
<>
<Text>Screen 1</Text>
import * as React from 'react';
import {Text} from 'react-native';
import {NavigationContainer} from '@react-navigation/native';
import {createNativeStackNavigator} from '@react-navigation/native-stack';
// Our Screens
function Screen1() {
return <Text>Screen 1</Text>;
}
import * as React from 'react';
import { Text } from 'react-native';
// Imports related to navigation
import {NavigationContainer} from '@react-navigation/native';
import {createNativeStackNavigator} from '@react-navigation/native-stack';
// Initialize the Stack navigator
const Stack = createNativeStackNavigator();
<button onclick="console.log(this.tagName.toLowerCase())">
Click to see the name of tag
</button>
@rahgurung
rahgurung / this.js
Last active December 6, 2021 19:01
var doSomething = (() => this.a);
var a = "From Global";
var Context = {a: 'Hello World!'};
// Use bind to set the `this` context
var x = doSomething.bind(Context);
console.log(x()); // From Global
// Use call to set the `this` context
function doSomething() {
return this.a;
}
var x = doSomething.bind({a: 'Hello World!'});
console.log(x()); // Hello World!