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

"window" and "e.target" have type issues #405

Closed
akaFTS opened this issue Sep 26, 2021 · 4 comments
Closed

"window" and "e.target" have type issues #405

akaFTS opened this issue Sep 26, 2021 · 4 comments

Comments

@akaFTS
Copy link

akaFTS commented Sep 26, 2021

Two very common use cases in React are reporting type issues on Aleph/Deno. The first one is window.open:

  window.open("https://github.com/akaFTS/bcc-data", "_blank");
Property 'open' does not exist on type 'Window & typeof globalThis'.deno-ts(2339)

And the other one is "e.target.value" when handling uncontrolled inputs:

onChange={(e) => setInput(e.target.value)}
Property 'value' does not exist on type 'EventTarget & HTMLInputElement'.deno-ts(2339)

Not sure if those issues are related to Aleph or Deno itself, but I couldn't find any solutions online.

@ije
Copy link
Member

ije commented Sep 26, 2021

@akaFTS
Copy link
Author

akaFTS commented Sep 26, 2021

Wouldn't it make sense to add those flags to the tsconfig file inside Aleph? Stuff like reading input values using e.target.value are very common in React, so perhaps Aleph should handle appropriate typing for those.

@ije
Copy link
Member

ije commented Sep 26, 2021

i added the config in 7ec39d8

@ije ije closed this as completed Sep 26, 2021
@JoshuaWise
Copy link

JoshuaWise commented Oct 21, 2021

Adding a deno.json doesn't do anything unless the --config flag is passed to the deno executable (which I assume needs to happen within aleph).

Reference: https://deno.land/manual/typescript/configuration#configuring-typescript-in-deno

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

3 participants