Skip to content

[React 19] Custom element event naming issue in React 19 with TypeScript #32258

@wsuwt

Description

@wsuwt

Summary

Hi React team,

First off, thank you for making custom elements fully compatible with React 19! It’s been a great experience writing less code while leveraging custom elements.

I came across an issue when using a custom element with events in a React TSX file (as shown in the picture below). TypeScript throws an error when the event name doesn’t contain a hyphen (-). However, based on the test cases here, it looks like event names should be valid as long as they follow the on- prefix.

Image

Would love to hear your thoughts on this—happy to provide more details if needed!

Repository: https://github.com/wsuwt/react-v19-ts-custom-element

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions