본문 바로가기
Frontend#Frontend#React조회 19

useOptimistic란?

정의

React 19의 낙관적 업데이트 훅. 서버 응답 전 즉시 UI 반영.

useOptimistic이란?

서버 Action 실행 중에도 "성공했다 치고" UI를 먼저 보여주는 훅이다.

const [optimistic, addOpt] = useOptimistic(messages);
addOpt({id:'temp', text});
await serverAction(...);

실패 시 자동 롤백. React 19 Server Actions 스택의 일부.

📘 관련 기술노트

전체 보기 →

🔗 함께 보면 좋은 용어

Frontend 전체 →