Hitmands
Hitmands

Reputation: 14179

Default Imports work differently between Babel and Typescript

This is perfectly fine for Babel/Webpack

import React from 'react';

but in Typescript needs to be:

import * as React from 'react';

what's the reason?

Upvotes: 0

Views: 115

Answers (1)

gilamran
gilamran

Reputation: 7294

Add allowSyntheticDefaultImports to your tsconfig.json to allow default imports from modules with no default export.

Upvotes: 3

Related Questions