Skip to content

Instantly share code, notes, and snippets.

/*
from Dave Gray
https://www.youtube.com/watch?v=MHm-2YmWEek&ab_channel=DaveGray
Usage:
const debouncedSearchValue = useDebounce(searchValue, 1000)
*/
/*
ShadCN + RHF + Zod examples from tomphill
by Tom Phillips
https://github.com/tomphill/shadcn-form-tut/blob/main/app/page.tsx
*/
"use client";
import * as z from "zod";
@KangWoosung
KangWoosung / #_Login.tsx
Last active May 14, 2024 16:13
Login with React-Hook-Form + Zod + Resolver
/* 2024-04-25 00:13:11
React-Hook-Form + Zod + Resolver
*/
"use client";
import { InputGroup } from "@/app/util/InputGroup";
import { LogInSchemaType, logInSchema } from "@/app/zodSchemas/logInSchema";
import { zodResolver } from "@hookform/resolvers/zod";
import React, { useState } from "react";
@KangWoosung
KangWoosung / ChatContext.tsx
Last active May 2, 2024 01:39
React useReducer + useContext Utility Example for global state management
/* 2024-04-27 04:11:52
useReducer & useContext utility functions.
Todos:
1. initState
2. Reducer.Action_Types
3. Reducer function
4. useReducer Custom hook function
5. initContextState