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.

Wrong importation of React in typings

See original GitHub issue

All typings starts with import React from 'react'; Because React doesn’t have a default, in typescript it should be import * as React from 'react';

As a result I get diagnostic errors like

Error:(21, 13) TS2605:JSX element type 'Menu' is not a constructor function for JSX elements.
  Property 'setState' is missing in type 'Menu'.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

0reactions
lock[bot]commented, May 24, 2018

This thread has been automatically locked because it has not had recent activity. Please open a new issue for related bugs and link to relevant comments in this thread.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cannot use import statement outside a module [React ...
When building a web application, you may encounter the SyntaxError: Cannot use import statement outside a module error. This error might be ...
Read more >
Why does require('react') cause "Import declaration ...
If I remove the import or require, however, I get a "React" undefined error. It appears that it does require some kind of...
Read more >
Typescript imports are incorrectly imported from `@types/`
What steps will reproduce the problem? Use jsx in a tsx file. Get the prompt to import react. Import react; WS inserts import...
Read more >
Documentation - TypeScript 3.8
TypeScript 3.8 adds a new syntax for type-only imports and exports. ... error! 'Component' only refers to a type, but is being used...
Read more >
Strict Mode
import React from 'react'; function ExampleApplication() { return ( <div> ... or it may invoke them without committing at all (because of an...
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