javascript - importing TypeScript vs ES2015 -


i trying figure out why typescript not picking "default export" of react. e.g. in javscript files using:

import react 'react'; import reactdom 'react-dom'; 

but in typescript have use (after googling):

import * react "react" import * reactdom "react-dom" 

i starting out fresh project after being unable import existing project , g et vs2k15 compile it.

what difference, if any? there way specify "module 'react' has no default export".

i can see in react file there

declare module "react" {     export = __react; } 

is not considered default export

i tried

import __react "react" 

but same error.

a default export giving 1 of exports alias "default". can using following syntax:

export default function __react {     //do work } 

you can use following syntax:

function __react {     //do work }  export {__react default}; 

Comments

Popular posts from this blog

ios - Memory not freeing up after popping viewcontroller using ARC -

Django REST Framework perform_create: You cannot call `.save()` after accessing `serializer.data` -

Why does Go error when trying to marshal this JSON? -