What is the necessary of making getter setter and classes when we can directly condition render component through the prop, I felt puzzled there
@codingwithlulu29 күн бұрын
A Singleton in React is useful when you want just one instance of something, like an authentication service or a connection, across the whole app. Think of it as a "one and only" object that's shared everywhere to avoid duplicates. You'd use it when: Global services like login or API need to be consistent everywhere. Expensive stuff (like a WebSocket) shouldn’t be created more than once. Shared state is needed across different parts of your app without duplicating logic. But in most cases, React’s own tools-like useContext or libraries like Redux-are enough, so only use Singleton if you really need that "one-instance-only" guarantee!
@rofayelАй бұрын
I dunno why im watching this video, I have exam tomorrow and i'm not even learning react
@sexy_audiosАй бұрын
🤣🤣
@codingwithluluАй бұрын
Hope you enjoyed it and hope your exam went well too 😀