r/reactjs • • Jan 25 '20

Is there any tutorial that shows someone fixing up a badly written React app?

I feel you can learn more by watching someone fix up an application rather than building it from the ground up. Is there any tutorial like that?

122 Upvotes

39 comments sorted by

View all comments

Show parent comment

4

u/2020-2050_SHTF Jan 25 '20

3

u/dingdongfootballl Jan 25 '20

Your code looks fine my man. Well either that or mines shitty too.

0

u/rgrome0105 Jan 25 '20

I don’t recommend overusing Context/Provider, if what you want to have is to be able to change and persist state across components more easily, I think what you must be using is Redux or still use Context but instead of having a lot of states maybe just use a native reducer.

Also I’ve noticed that in some components you have

const { state1 } = useContext(Context)
const { state2 } = useContext(Context)

Instead I think it would be more readable as

const { state1, state2 } = useContext(Context)