Skip to content

Missing TypeScript declaration for LocationProvider.ctx #88

Closed
@pallosp

Description

@pallosp
  • [ 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

  1. Wrap your app into <LocationProvider>
  2. Add static contextType = LocationProvider.ctx; to one of your class components
  3. 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

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions