4 ms·
For typescript to be very useful to indispensable the tooling needs to improve. If there was a checkbox on VSC that said “use typescript” for a project and I h
by holografix 7y ago
For typescript to be very useful to indispensable the tooling needs to improve.
If there was a checkbox on VSC that said “use typescript” for a project and I had to do nothing else for it to work then sure, I’d use it.
For a single dev working on a fairly simple React + Redux app it’ll slow you down like no tomorrow.
- onion2k 7y agoWhat you're asking for mostly exists. You don't even need a checkbox. TypeScript support has been included with create-react-app since v2.1.0, with all the features enabled. VS Code ships with syntax highlighting and command completion for TS. If you want to try it use; npx create-react-app tsx-test yarn add typescript @types/react mv ./src/App.js ./src/App.tsx yarn start (WARNING: npx runs stuff from the internet on your machine) That will make a 'typescript' React app run on your machine. Obviously App.tsx isn't actually doing any TypeScript stuff, but if you add some it will work.
- wereHamster 7y agoEven simpler, see https://create-react-app.dev/docs/adding-typescript https://create-react-app.dev/docs/adding-typescript npx create-react-app my-app --typescript
- resurge 7y agoNote that they said "React + Redux". And that combo indeed takes a lot more time to get set up and understand the first time. I used this lib to get it to work: https://www.npmjs.com/package/typesafe-actions https://www.npmjs.com/package/typesafe-actions I wouldn't even know how to get it to work with just the regular react & redux types.
- onion2k 7y agotypesafe-actions looks useful but you don't strictly need it. You can use redux with TS just by adding @types/react-redux. https://redux.js.org/recipes/usage-with-typescript#usage-with-react-redux https://redux.js.org/recipes/usage-with-typescript#usage-wit...
- deleted 7y ago[deleted]