Skip to content

Missing TypeScript declaration for LocationProvider.ctx #89

Closed as duplicate of#88
@pallosp

Description

@pallosp

Describe the bug

When I try to use LocationProvider in a class Component, type checking fails at the static context = 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 context = 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

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions