Knowledge · frontend

Generic Context Factory

Working around the fact that a const declaration can't take type parameters — creating the context inside a generic function and letting the components capture it by closure, plus the trap where calling it during render silently remounts everything

Date
2026-08-23
Reading time
6 min
Confidence
Inferred

This page is a machine translation of the Korean original. Read the original

Document graph

Related documents

Documents that mention this

Related Knowledge

Tags

reacttypescriptcompound-componentcontextgenerics