Closed
Description
- [ x ] Check if updating to the latest
preact-iso
version resolves the issue
Describe the bug
When I try to use LocationProvider
in a class Component
, type checking fails at the static contextType = LocationProvider.ctx;
line. The code works anyway.
Property 'ctx' does not exist on type '(props: { scope?: string | RegExp; children?: ComponentChildren; }) => VNode<{}>'.ts(2339)
To Reproduce
- Wrap your app into
<LocationProvider>
- Add
static contextType = LocationProvider.ctx;
to one of your class components - Run
npx tsc
Environment
- OS: MacOS 15.5
- Node version: 22.14.0
- TypeScript version: 5.8.3
- preact-iso version: 2.9.1
- preact version: 10.26.6
Metadata
Metadata
Assignees
Labels
No labels