TypeScript typings do not export <Root>
See original GitHub issueAre you reporting a bug?
Yes.
I’m trying to upgrade a project to v6, and one of the first things I’m running into is that I want to import { Root} from 'react-static'
, but TypeScript tells me
Module ‘“react-static”’ has no exported member ‘Root’. (2305)
Which is correct: I don’t see Root being exported from index.d.ts
.
Environment
react-static -V
: 6.0.9node -v
: v10.14.1npm -v
: 6.4.1yarn -v
(I use Yarn): 1.12.3- Operating system: Ubuntu 18.04.1 LTS
Steps to Reproduce the problem
Base your steps off of any freshly installed react-static template!
I can’t really provide the steps from a basic template yet as I have yet to write a plugin for TypeScript, but basically, the line import { Root, Routes } from 'react-static'
that is in the freshly-installed template will not work if TypeScript were to be enabled.
Expected Behavior
The TypeScript typings to be up-to-date with v6.
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
Typescript typings have no default export · Issue #533
In version 6.2.1 the tsc compiler complains that 'react-day-picker' has no default export. ... // **\node_modules\react-day-picker\types\index.d.
Read more >TypeScript. How to use not exported type definitions?
I found this problem when I tried import .d.ts file of JS lib and I don't have ability to export needed interface. Can...
Read more >Documentation - Modules .d.ts - TypeScript
For example, here is a module which exports a function and a numerical constant: ... You may want to provide a type for...
Read more >Avoid Export Default - TypeScript Deep Dive
Re-exporting is common for the root index file in npm packages, and forces you to name the default export manually e.g. export {...
Read more >TypeScript library tips: Rollup your types! | by Martin Hochel
As a not very known technique apply this pattern also on your ambient types definitions, that are generated by TypeScript compiler ...
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 Free
Top 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
Yes, I hope to look at it over the holidays. I take it the typings as a whole then are not updated for v6?
Btw, if it’s not officially supported, it might be worthwhile to consider moving the typings to DefinitelyTyped? That’s usually a sign that they’re more likely to be lagging behind the official project compared to when the project itself hosts them. But for now I’ll submit them here if I get around to it 😃
@bernatfortet I just found out that there was already PR #891 that adds exactly that 😃