Just a quick note today as I stumbled over a a nice GitHub repo:
We've made good experiences writing React Applications with TypeScript -- and I just now stumbled across a good cheat sheet which summarizes many of the lessons learned:
a cheatsheet for react users using typescript with react for the first (or nth!) time
Table of Contents
Expand Table of Contents
- Section 1: Setup
- Section 2: Getting Started
- Section 3: Advanced Guides
- Section 4: Useful Patterns by TypeScript Version
- Section 5: Misc. Concerns
Kickstart guide for React Redux Apps written in TypeScript
React TypeScript kickstart
This gitbook serves as a guide for kickstarting a new React project with preconfigured Redux, TypeScript, Sass, Storybook and unit testing.
These tools are needed to start developing.
# nvm brew install nvm # node (latest lts version) nvm install --lts # set latest stable lts as default nvm alias default stable # be tripple shure you use the right node version nvm use default # yarn brew install yarn --without-node
We recommend to use VSCode as editor Install the following Extensions:
TSLint-> linting support directly in editor (marketplace)
Type safe React & Redux Snippets in TypeScript-> Snippets for boilerplate code as shown in Cookbook (marketplace)
In the cookbook you will find skeletons for important modules. These skeletons are also available for VSCode as snippets in the VSCode marketplace.
Example (Component with defaultProps)
Look, ma! Intellisense!
We've also published [a VSCode Snippet Extension(https://marketplace.visualstudio.com/items?itemName=Sandstorm.vscode-awesome-ts-react-redux-snippets) which helps to write TypeScript/React with little boilerplate.
What are your experiences writing React + TypeScript?
All the best,