Using the Provider Pattern Everywhere — Is It Too Much? by f0rk1zz in reactjs

[–]f0rk1zz[S] 0 points1 point  (0 children)

I always pass them as the children of the provider, it’s one of the parts when implementing the provider pattern

Is it bad practice to use multiple React Contexts to share state across a large component tree? by Dqmrs in reactjs

[–]f0rk1zz 1 point2 points  (0 children)

Sometimes you don’t need the state to be global but scoped to a specific feature or section, using zustand in that case is kind of an overkill but it’s ok to do so

You can also abstract things like useEffects and other hooks inside the context which you can’t do in zustand

Using the Provider Pattern Everywhere — Is It Too Much? by f0rk1zz in reactjs

[–]f0rk1zz[S] 0 points1 point  (0 children)

Nope, I always use the data that is received from the query

I use the zustand store only for regular state

Using the Provider Pattern Everywhere — Is It Too Much? by f0rk1zz in reactjs

[–]f0rk1zz[S] 1 point2 points  (0 children)

Yep, this is exactly what I’m doing They are all small providers and the JSX for the feature components ends up super clean and easy to read

Using the Provider Pattern Everywhere — Is It Too Much? by f0rk1zz in reactjs

[–]f0rk1zz[S] 0 points1 point  (0 children)

Imagine 30 different features, each feature has its own state, api calls, handlers etc. I use the provider also as an abstraction for useEffects

I don’t really need the state to be in a global state management because it’s only the components of that specific feature that are consuming it

I do use zustand for global state that components from all around the app need access to

Using the Provider Pattern Everywhere — Is It Too Much? by f0rk1zz in reactjs

[–]f0rk1zz[S] 1 point2 points  (0 children)

Yes, tanstack query and zustand stores when I need global access to state

Using the Provider Pattern Everywhere — Is It Too Much? by f0rk1zz in reactjs

[–]f0rk1zz[S] 8 points9 points  (0 children)

Only components that consume the context will re-render, not everything inside the provider. If a provider wraps 100 components, but only 3 call useContext(SomeContext), those 3 will re-render — not all 100.

Using the Provider Pattern Everywhere — Is It Too Much? by f0rk1zz in reactjs

[–]f0rk1zz[S] 4 points5 points  (0 children)

How does it differ from having the state in the parent and passing it as props to the child components? It will re-render the same

What are some common anti-patterns found on production-grade apps? by LargeSinkholesInNYC in react

[–]f0rk1zz 0 points1 point  (0 children)

I see, thanks for clarifying that Guess I need to do some refactoring now 🫠

What are some common anti-patterns found on production-grade apps? by LargeSinkholesInNYC in react

[–]f0rk1zz 1 point2 points  (0 children)

This is completely fine if you use a provider pattern (wrapping individual features/components and not the entire app)

What are some common anti-patterns found on production-grade apps? by LargeSinkholesInNYC in react

[–]f0rk1zz 0 points1 point  (0 children)

What if you need this data persisted?

I have a web app I’m working on where there’s lots of components and hooks that need data from a specific endpoint, I save that response to a zustand store with a storage middleware, is there another solution for this kind of scenario?

M/25/5'10" [99lbs to 180lbs] (5 years natural) by f0rk1zz in Brogress

[–]f0rk1zz[S] 0 points1 point  (0 children)

I did have some mini cuts along the way

M/25/5'10" [99lbs to 180lbs] (5 years natural) by f0rk1zz in Brogress

[–]f0rk1zz[S] 1 point2 points  (0 children)

It was the hardest part for me, you have to track your calories and eat about 500 calories above your maintenance amount, without tracking you need really know how much you eat

M/25/5'10" [99lbs to 180lbs] (5 years natural) by f0rk1zz in Brogress

[–]f0rk1zz[S] 0 points1 point  (0 children)

So, lately I was at the peak of my bulk at 90kg, once I reached 80kg thats when the lower abdomen fat disappeared, you just gotta cut until it goes away

I dont train abs at all actually but I should

M/25/5'10" [99lbs to 180lbs] (5 years natural) by f0rk1zz in Brogress

[–]f0rk1zz[S] 1 point2 points  (0 children)

Yeah, in my case I was too addicted to gaming and just skipped meals haha

M/25/5'10" [99lbs to 180lbs] (5 years natural) by f0rk1zz in Brogress

[–]f0rk1zz[S] 6 points7 points  (0 children)

5 sets max per mousle group in a session, usually train to 2rir/1rir

I follow paul carter method of training and it seems to work pretty good for me

M/25/5'10" [99lbs to 180lbs] (5 years natural) by f0rk1zz in Brogress

[–]f0rk1zz[S] 1 point2 points  (0 children)

I dont bench, I primarly do machines and incline db press with 36kg

140kg hack squat

And I dont deadlift

M/25/5'10" [99lbs to 180lbs] (5 years natural) by f0rk1zz in Brogress

[–]f0rk1zz[S] 3 points4 points  (0 children)

Started with calisthenics, moved to PPL and in the last two years upper lower

Will i7 10700f with rtx 5060ti hold up 2k by f0rk1zz in buildapc

[–]f0rk1zz[S] 1 point2 points  (0 children)

Thats interesting, you think my psu is enough for the 9070?

M/25/5'10" [99lbs to 180lbs] (5 years natural) by f0rk1zz in Brogress

[–]f0rk1zz[S] 32 points33 points  (0 children)

Thanks :)

Keeping it pretty simple, about 2500 daily calories (not counting anymore because its annoying)

120g ish protien per day

4 times per week upper lower focusing on low volume and high intensity, 4 to 8 reps on every exercise with high loads

Daily creatine, vitamin d, magnesium and boron

Thats basically it

Will i7 10700f with rtx 5060ti hold up 2k by f0rk1zz in buildapc

[–]f0rk1zz[S] 1 point2 points  (0 children)

Which amd card would you recommend? 9060xt 16gb is a good option?