typescript-react-boilerplate
Just clone and rename to create your own React app
Based on
- typescript
- react (with hooks)
- react-router
- react-hot-loader
- css-modules
- webpack
Testing
- jest
- enzyme
Linter
Something you should know
-
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. -
The typescript-eslint is still a very new thing, which means the related configurations may change in the future.