- typescript
- react (with hooks)
- react-router
- react-hot-loader
- css-modules
- webpack
- jest
- enzyme
-
In
transpileOnly
mode ofts-loader
, theTypescript
compiler will not generate declaration files, but you can generate them viatsc
. -
When using CSS Modules:
-
You should add a declaration file for e.g.
*.less
files, for example, less.d.ts. -
To make the Iconfont work properly with CSS Modules, you have to import the styles in the global scope:
:global { @import "~font-awesome/less/font-awesome.less"; }
-
-
While using react-router, you should use
withRouter()
as a function call instead of as a decorator (@withRouter
), becauseTypeScript
doesn't allow decorators to change the signature of the classes they are decorating. -
In jest.config.js, the primary challenge is how to configure the
rootDir
appropriately.