r/reactjs • • Jul 01 '18

Help Beginner's Thread / Easy Question (July 2018)

Hello! just helping out /u/acemarke to post a beginner's thread for July! we had almost 550 Q's and A's in last month's thread! That's 100% month on month growth! we should raise venture capital! /s

Got questions about React or anything else in its ecosystem? Stuck making progress on your app? Ask away! We’re a friendly bunch. No question is too simple. You are guaranteed a response here!

New to React? Free, quality resources here

Want Help on Code?

  • Improve your chances of getting helped by putting a minimal example on to either JSFiddle (https://jsfiddle.net/Luktwrdm/) or CodeSandbox (https://codesandbox.io/s/new). Describe what you want it to do, and things you've tried. Don't just post big blocks of code.
  • If you got helped, pay it forward! Answer questions even if there is already an answer - multiple perspectives can be very helpful to beginners. Also there's no quicker way to learn than being wrong on the Internet.
51 Upvotes

454 comments sorted by

View all comments

Show parent comment

1

u/swyx Jul 30 '18

hahah oh dear. fail to plan and you plan to fail!

redux would be a great choice for something like this, because theres a ton of middleware to help you do awesome things like persist to local storage or indeed save state to your db of choice. you could conceivably do this with context but you'd have to roll that on your own, and why should you?

acemarke hangs out here so pop him a redux question iff you really get stuck.

this is a great lesson tho. code "broad" before you code "deep". make sure you have a good idea of the high level end to end user flow before you dive into the more nested/complicated features.

p.s. you never need to explain typescript around here. we are fans :)

1

u/[deleted] Jul 30 '18

Haha, thanks. I'll do some learning on Redux. I at least had the wisdom to realize my approach was flawed before I got too far into it, and only truly need to rewrite two or three components.

1

u/swyx Jul 30 '18

great stuff. you wont even remember this in a year, dont sweat it