Typing issue with @DragDropContext decorator
See original GitHub issueHi There, I am new to react-dnd, I am using typescript to build up my first test project with dnd.
@DragDropContext(HTML5Backend) export class DragTest extends React.Component<{}, undefined> { render() {return (<div></div>);} }
And I get the following compile typing error:
TS1238: Unable to resolve signature of class decorator when called as an expression.
Type 'ContextComponentClass<{}>' is not assignable to type 'typeof DragTest'.
Type 'ContextComponent<{}, any>' is not assignable to type 'DragTest'.
Types of property 'render' are incompatible.
Type '() => Element | null' is not assignable to type '() => Element'.
**Type 'Element | null' is not assignable to type 'Element'.**
Type 'null' is not assignable to type 'Element'.
I appreciate your comment, Thanks
Issue Analytics
- State:
- Created 6 years ago
- Reactions:2
- Comments:9
Top Results From Across the Web
reactjs - How to decorate my React component correctly when ...
I am trying to add the @DragDropContext decorator on my class but I am getting an error when I load it in my...
Read more >Adding drag-and-drop functionality with react-beautiful-dnd
As we learned above, the first step is to create a DragDropContext that encloses everything we want on our list. In it, we...
Read more >Implementing Drag and Drop - SurviveJS
In order to set it up, we need to use the DragDropContext decorator and provide the HTML5 back-end to it. To avoid unnecessary...
Read more >@types/react-dnd-html5-backend | Yarn - Package Manager
This is a stub types definition. react-dnd-html5-backend provides its own type definitions, so you do not need this installed.
Read more >react-beautiful-dnd - npm
We recommend that you don't raise issues or pull requests, as they will not be ... Accessible: powerful keyboard and screen reader support ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Same with me.
FWIW, I don’t get the error if I use the ES6 way: export default DragDropContext(HTML5Backend)(DnDTest);