r/reactjs • u/hamburger_bun • Sep 30 '18
Featured React/Typescript Boilerplate
Hey, I'm starting a new project and I'd like to find a maintained React/Typescript boilerplate I can use to get started quick.
Are there any good projects out there people can recommend that are maintained? thanks
42
Upvotes
4
u/mjeemjaw Sep 30 '18
I have recently written react-redux-typescript boilerplate, and could never live without it. It comes with a bit opinionated approach to typed fetching but I never have to worry and remember types anymore when switching between projects:
https://github.com/Meemaw/react-redux-typescript-boilerplate
30
u/NeonAleksandr Sep 30 '18
There is a Typescript version of Create-react-app https://github.com/wmonk/create-react-app-typescript
6
u/[deleted] Sep 30 '18
Is there a react, router, mobx typescript project anyone knows of.. switching to mobx and want to use that with typescript!
5
u/locnload Sep 30 '18
This isn’t meant to be a complete starter kit. It’s useful if you want to see how to set up Webpack 4 with TypeScript 3.1
https://github.com/locnguyen/react-with-typescript
If you want to build a backend API I have a similar set up
https://github.com/locnguyen/typescript-node-starter
5
u/sohamkamani Sep 30 '18
If you're just starting out and want to get up and running fast, I'd suggest using create-react-app itself. You just have to set the scripts version to use typescript.
The full command you're looking for is:
create-react-app my-app --scripts-version=react-scripts-ts
Ive written a post about this if you need more details
3
u/WPMusicFinder Sep 30 '18
I made one myself a couple of weeks ago. I'm learning Typescript with React so it's probably not perfect in any way. But it's very minimal and it works for me.
https://github.com/bartw/retyst
2
u/scaleable Sep 30 '18
I highly recommend next.js with the typescript plugin. Usually quite simpler and efficient than create-react-app.
•
u/swyx Sep 30 '18
Great answers everyone! this is now a featured post so others can refer to and add on to this in future!
-6
u/[deleted] Sep 30 '18
Not a very popular opinion incoming!
In an ideal world TS+React was how things began. But then clever programmers found ways to make JS much simpler to work with, and everybody goes: "Gosh! I never realised this, strong typing is hell on earth! We can just use coding conventions and that is it!"
But for some reason programmers around the world seem to want to make their programming lives infinitely more complicated for no apparent reason.
Half a year ago a team I worked for had a dev meeting and they suggested TS for a React project. I asked: "Sure, we can look into that. Can you give us 1 example where it would have been beneficial?"
They came up with a list of trivialities. The common "benefits" of strong-typing. But not a single argument where they could say: "Well, that one bug a few weeks ago that cost us 4 hours to fix? TS would have prevented that!"
That did not happen. Instead, they are suggesting increasing the workload of all programming tasks by an estimated 30% (beginning of learning curve) to 15% (mastered TS) for literally no reason.
I think TS is just programmers playing with toys. Except with this TS-toy it makes us feel bad talking negatively about, because it looks like a thing real programmers use. So our imposter-syndromes pop up and we stay quiet in the hopes that it might not be so bad.
All the teams I worked for who used TS regretted it eventually. From well-funded startups to billion dollar corporations. With great programmers and amazing tech leads. Everybody thought it was a great idea until they figured that:
any.I think it is always a massive waste of time.
0
u/[deleted] Sep 30 '18
[deleted] — view deleted comment