Skip to content

PerformanceObserver accepts invalid callbacks until delivery #58238

Description

@OskarEichler

Description

PerformanceObserver stores its constructor argument without validating that one was supplied or that it is callable. Missing, null, and other non-function callbacks therefore create invalid observer instances and fail only later when native delivery attempts to invoke the value.

Expected behavior

Construction without the required argument should throw synchronously, and an explicitly supplied non-function should throw the corresponding callback type error, matching the PerformanceObserver API contract.

React Native Version

0.87.1 and current main

Affected Platforms

New Architecture - All

Metadata

Metadata

Assignees

No one assigned

    Labels

    Needs: Author FeedbackNeeds: ReproThis issue could be improved with a clear list of steps to reproduce the issue.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions