question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Preact - Typescript issues

See original GitHub issue

Do you want to request a feature or report a bug?

  • I found a bug
  • I want to propose a feature

What is the current behavior? Typescript is throwing two issues from code I got from the examples.

If the current behavior is a bug, please provide the steps to reproduce.

<div {...getRootProps({className: style.dragZone})}>
    <input {...getInputProps()} />
    {
        isDragActive ?
            <p>Drop the files here ...</p> :
            <p>Drag 'n' drop some files here, or click to select files</p>
    }
</div>
<aside>
    <h4>Files</h4>
    <ul>{files}</ul>
</aside>    

Please mention other relevant information such as the browser version, Operating System and react-dropzone version.

I am using Preact, but I’m not sure why that would be relevant to the Typescript issues.

    "preact-cli": "^3.0.0-rc.7",
    "preact": "^10.2.1",
    "preact-render-to-string": "^5.1.4",
    "preact-router": "^3.2.1",
    "react-dropzone": "^10.2.1"

Typescript config

{
  "compilerOptions": {
    "jsx": "react",
    "jsxFactory": "h",
    "removeComments": true,
    "sourceMap": true,
    "experimentalDecorators": true,
    "emitDecoratorMetadata": true,
    "esModuleInterop": true
  },
  "exclude": [
    "node_modules"
  ]
}

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:10

github_iconTop GitHub Comments

12reactions
kirx76commented, Feb 3, 2021

up, same problem

1reaction
kirx76commented, Nov 17, 2021

How do you fix this?

Try to update library, just checking my old code, removed “//@ts-ignore” and theres no errors now

Read more comments on GitHub >

github_iconTop Results From Across the Web

TypeScript 4.1 + Preact: TypeScript does not pick up JSX. ...
This is Re: #40502 cc @weswigham @DanielRosenwasser Using the new JSX transform and Preact as import source, TypeScript doesn't seem to pick ...
Read more >
TypeScript
When you use Preact in a TypeScript-aware editor (like VSCode), you can benefit from the added type information while writing regular JavaScript.
Read more >
parcel-preact-typescript-boilerplate
Start using parcel-preact-typescript-boilerplate in your project by running `npm i ... GitHub license npm Downloads GitHub issues ...
Read more >
Fixing JSX types between Preact and React Libraries
To summarize, the main issue seems to be that, although Preact is “shipping” a lot of types needed for React compatibility, they aren't ......
Read more >
Preact/Typescript: Only allow a specific component as ...
It is not the problem at Preact level. It is a problem with TypeScript itself in regards to how it deals with JSX/TSX....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found