Common mistakes
Common mistakes in the Context guide.
value={signal()}. The provider reads the value once. Provide the accessor (value={signal}) or a store.- Calling
useContextin a handler, a timer or afterawait. There is no owner. Read it during setup and close over it, or capture the owner and userunWithOwner. createContext<string | undefined>(undefined)as an optional context. Anundefineddefault throws like no default. Usenull.- Importing a context from two copies of the package. Contexts are matched by a symbol created in
createContext. Two bundled copies of a module that defines a context have two symbols.