Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Type Definitions for JSX? #6

Open
saranshgrover opened this issue Jun 8, 2020 · 0 comments
Open

Type Definitions for JSX? #6

saranshgrover opened this issue Jun 8, 2020 · 0 comments

Comments

@saranshgrover
Copy link
Member

saranshgrover commented Jun 8, 2020

I'm trying to use the package for a typescript/react timer - and I'm unable to use the <scramble-display/> element. TS/JSX gets mad at me because the element is lowercase which means that it should be an intrinsic element (which it isn't). An easy fix for this is to add the following namesapce:

declare namespace JSX {
	interface IntrinsicElements {
		'scramble-display': any // https://wespeter.com/posts/consuming-web-component-react-typescript/
	}
}

I'm currently doing this myself - but it may be nice to have this in the package itself. The any type would ideally be replaced by the Element type, but I'm not sure if that typing is already there or not.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant