Closed samuelalvin closed 6 years ago
Hey Samuel,
Thanks for the PR.
I am a little reluctant to update the docs to use an import *
. Reasons being, while this also works in ES6 its not really a javascript standard when we have a default export. Not even React themselves do it in their docs
However, as you mention Typescript users need to use the import *
syntax. We've just assumed TS users would know this but perhaps we should make a specific note of this in the docs. If you updated this PR that just adds a small note under the first example for our typescript users I would be happy to merge it.
Hi @jennasalau,
I've reverted the code and add the import note for Typescript user below the example as you suggest. Let me know if there is more that I need to tweak.
In Typescript, importing ReactHabitat this way:
import ReactHabitat from 'react-habitat';
, cause this error:Importing it this way:
import * as ReactHabitat from 'react-habitat';
solves the problem.