Common Mistakes in Conditional Renderinghttps://youtu.be/Rr5AqASIyxw TL;DR When using 0 in JSX, although it's falsy, it still gets rendered. Official documentation specifically warns to be careful Logical AND operator (&&) Be especially mindful of the usage of the number 0 when using...Aug 20, 2023 · 1 min readjason60810.hashnode.dev
Always Use a Custom Hook for Context API, Not useContext (React Context API, TypeScript)https://youtu.be/I7dwJxGuGYQ Step 1: Create the Theme Context First, we need to create the context for our theme. import React, { createContext, useState } from 'react'; type Theme = 'dark' | 'light'; type ThemeContextProps = { theme: Theme; s...Aug 13, 2023 · 2 min readjason60810.hashnode.dev
LeetCode - 21. Merge Two Sorted ListsSolution with comments //=========== visualization ==================== Initial state: l1: { val: 1, next: { val: 2, next: { val: 4, next: null } } } l2: { val: 1, next: { val: 3, next: { val: 4, next: null } } } //=========== visualization...Apr 9, 2023 · 5 min readjason60810.hashnode.dev
Using REST APIs with Protobuf in a Next.js and TypeScript App (Backend in Go)Compiling .proto Files into TypeScript Using ts-proto In my experience working with an Nx monorepo Next.js project on Windows, I encountered a path issue that prevented me from compiling the .proto file directly. To resolve this problem, I had to cre...Mar 26, 2023 · 2 min readjason60810.hashnode.dev
Next.js Tutorial For Beginnershttps://youtu.be/qwhMyVVnmKM nextjs-youtube-demo Link Global Layout and CSS Nav dynamic className base on the route getStaticProps export async function getStaticProps() { const response = await fetch("https://learnwebcode.github.io/json-examp...Mar 12, 2023 · 2 min readjason60810.hashnode.dev