Skip to content

Instantly share code, notes, and snippets.

View kaung8khant's full-sized avatar
🤓
back in school

Sai Khant kaung8khant

🤓
back in school
View GitHub Profile
@kaung8khant
kaung8khant / App.js
Last active June 7, 2023 15:18
Lazy Loading with React, GraphQL and Formik (Phone number input - country code with flag)
import React from "react";
import { gql } from "apollo-boost";
import { Form,Dropdown } from "semantic-ui-react";
import PhonePrefix from "PhonePrefix";
//use graphql for api call
const COUNTRY_QUERY = gql`
{
countries {
id
@kaung8khant
kaung8khant / HomeScreen.js
Last active September 9, 2020 21:10
useContext (React Hook)
import React, { useContext, useState } from "react";
import Tab from "./Tab";
import { MyContext } from "../MyContext";
const HomeScreen = () => {
const [tab, setTab] = useState(0);
const value = { tab, setTab };
return (
<MyContext.Provider value={value}>
<Tab />