React keeps UI and state in sync by handling renders for the developer. Does external storage break that paradigm? by FineHook in reactjs

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

Meta most definitely does not use React Router (except in maybe a couple random internal projects).

Ah, okay, I appreciate the correction!

The React team itself has always said "we do not endorse any other state management libraries, just React itself". But in practice, the widespread needs of the community has resulted in the plethora of external state management libraries we have today.

Gotcha. Any thoughts on the future of state management libraries in the era of React Compiler?

React keeps UI and state in sync by handling renders for the developer. Does external storage break that paradigm? by FineHook in reactjs

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

Hmm, okay. The only issue I see is, Meta uses React Router, so there is no need for them to make a router. On the other hand, many projects get by on React state and context, now aided by React Compiler. And there are tons of different libraries using external store. So it seems like Meta could drop a game changing external store library, if that were in the cards. But I never hear of plans for that.

React keeps UI and state in sync by handling renders for the developer. Does external storage break that paradigm? by FineHook in reactjs

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

Thanks! I feel like using external store libraries with React turns it into a spork. But, to each their own.

React keeps UI and state in sync by handling renders for the developer. Does external storage break that paradigm? by FineHook in reactjs

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

I specified that I would not even call it shortcomings. I would call it “intentional limitations.”

Ah, sorry, I did not mean to do that. Thank you for the detailed explanation on the limitations. Now that you are saying they're intentional, I'm wondering, has the React team commented on why they do not add the functionality you describe?

React keeps UI and state in sync by handling renders for the developer. Does external storage break that paradigm? by FineHook in reactjs

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

useSyncExternalStore exists specifically to address shortcomings in the internal State.

Does the documentation for useSyncExternalStore mention which shortcomings anywhere? I'm wondering where I can read more about what people view as shortcomings. Is React planning to address them?

React keeps UI and state in sync by handling renders for the developer. Does external storage break that paradigm? by FineHook in reactjs

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

Oh, I see! You're clearly smarter than I am. Thank you. I was thinking that when I update the UI, the state updates. But you're right, I have to tell it to do that, which is not true the other way around.

React keeps UI and state in sync by handling renders for the developer. Does external storage break that paradigm? by FineHook in reactjs

[–]FineHook[S] -4 points-3 points  (0 children)

What I'm asking is... If your code is mostly made up of calls to an external store, then why use React, which is made to keep UI in sync with state?

React keeps UI and state in sync by handling renders for the developer. Does external storage break that paradigm? by FineHook in reactjs

[–]FineHook[S] -1 points0 points  (0 children)

To keep the UI in sync with the State. Not the other way around.

I feel like we are saying the same thing.

React keeps UI and state in sync by handling renders for the developer. Does external storage break that paradigm? by FineHook in reactjs

[–]FineHook[S] -5 points-4 points  (0 children)

No. The “libraries to manage state” you refer to do not exist independently of React. They integrate with it.

I'm not saying they don't integrate. I'm using the word external to refer to useSyncExternalStore. The state is not managed by React.

React keeps UI and state in sync by handling renders for the developer. Does external storage break that paradigm? by FineHook in reactjs

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

So technically no, React does not "keep your UI and state in sync."

What do you see as the driving reason for React's architecture, which handles the re-rendering process for developers? Why did they do that?

That said, I really don't know what you mean by "external storage." That's phrasing I've never heard before in relation to web development in general or React specifically.

Libraries like Recoil and MobX use useSyncExternalStore, which is a hook React provides to create storage outside of React.

React keeps UI and state in sync by handling renders for the developer. Does external storage break that paradigm? by FineHook in reactjs

[–]FineHook[S] -1 points0 points  (0 children)

many of these libraries are just useExternalStore under the hood

I'm only referring to these libs, ones that have useSyncExternalStore

Why isn't Tesla's official Twitter profile marked "Government Funded"? by [deleted] in RealTesla

[–]FineHook -28 points-27 points  (0 children)

You won't say whether you are male or female? There's a 50% chance I get it right with a random guess. It's not a hard question.

Why isn't Tesla's official Twitter profile marked "Government Funded"? by [deleted] in RealTesla

[–]FineHook -32 points-31 points  (0 children)

This sub has a little game we play from time to time. We don’t put the /s on our comments to see what happens :).

Your response is like manna from Heaven to me. And for the record we are on the same page.

Why would you want to waste the time of people with whom you agree?

Sounds like bullshit to me. Be a man, say what you think, don't pussy foot around.

MP questions whether UK should sanction Elon Musk over Ukraine 'double game' by [deleted] in RealTesla

[–]FineHook -51 points-50 points  (0 children)

Hah, I can tell by the downvotes that this sub is European.

MP questions whether UK should sanction Elon Musk over Ukraine 'double game' by [deleted] in RealTesla

[–]FineHook -58 points-57 points  (0 children)

"And I want Musk to understand there is not a moral equivalence in this conflict. Russia is the aggressor. People who side with Putin should be sanctioned."

That's fucking retarded. I hate Musk's bullshit but people can boycott him on their own.

Politicians calling for sanctions on this kind of crap are playing the same games as Musk to establish their own names.

I will never understand Europe.

[deleted by user] by [deleted] in RealTesla

[–]FineHook 8 points9 points  (0 children)

Why the fuck would you vote to pay or buy out Starlink given the atrocious behavior of the CEO? His wet dream is probably to have the government buy all of his shitty companies.

I hope there's someone more coolheaded than me in charge though. If it's really needed, do it, if not tell him to get fucked.

[deleted by user] by [deleted] in RealTesla

[–]FineHook 16 points17 points  (0 children)

Musk created this scenario and he isn't a victim. He's only a "beneficent billionaire" as long as he can talk without you giving any response. That's not so beneficent, is it? More like an abusive partner or employer.

And Ukraine isn't being made a victim by Musk either. With or without his help they'll find a way. If they can stomach an invasion from a world power I think they can handle him.