crazyfactory / ts-react-boilerplate

Universal React App with Redux 4, Typescript 3, and Webpack 4
MIT License
116 stars 29 forks source link

Upgrade router5 to v7 #233

Closed paibamboo closed 5 years ago

paibamboo commented 5 years ago

But we need to set esModuleInterop to true in tsconfig.json because the way router5 imports react

import React from "react"

See https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-7.html for more info about esModuleInterop

cyberhck commented 5 years ago

can't we tell typescript to ignore anything inside node_modules?

paibamboo commented 5 years ago

As far as I know, we can't exclude it if our codes reference to it. As mentioned in the faq

if the file was found, it will be included regardless if it was excluded in the previous steps.

An alternative is to use skipLibCheck but that will exclude all *.d.ts files.

cyberhck commented 5 years ago

weird, I'm okay with enabling esModuleInterop, but maybe we should write a lint rule which forces react import to have only 1 way?

paibamboo commented 5 years ago

FYI, we still need to use the pattern import * as React from "react"; because styleguidist does not work when we do import React from "react";.

paibamboo commented 5 years ago

Closed by #251