Skip to content

Instantly share code, notes, and snippets.

View ellemedit's full-sized avatar
🏠
Working from home

Marshall Han ellemedit

🏠
Working from home
  • Seoul
  • 11:27 (UTC +09:00)
View GitHub Profile
@ellemedit
ellemedit / form.tsx
Created November 25, 2024 07:51
Form submit without resetting in React 19
export function Form() {
const [isPending, startTransition] = useTransition()
return (
<form
onSubmit={(event) => {
event.preventDefault()
const formData = new FormData(event.currentTarget)
startTransition(async () => {
await someAction(formData)
})
@ellemedit
ellemedit / NavigationIntercepter.tsx
Last active April 5, 2025 13:54
Next.js Navigation API intercepter
"use client";
// Next.js version of React ViewTransition fixture
// ref: https://github.com/facebook/react/blob/main/fixtures/view-transition/src/components/App.js
//
// Currently, it has a infinite rendering bug in React when you navigate for go or back
// wait for merging following PRs
// PR 1: https://github.com/facebook/react/pull/32821
// PR 2: https://github.com/vercel/next.js/pull/77856
//