React useFetch custom hook
Usage of useFetch custom React hook: // TODO: Add refetch method.
Usage of useFetch custom React hook: // TODO: Add refetch method.
useEffect is a React Hook that lets you synchronize a component with an external system. useEffect and fetch() example: useEffect and axios example: useEffect(): for optimizing performance. useEffect(): TimerComponent with cleanup calback. Timer component done incorrectly and will create infinite loop (using simple setCount syntax and no cleanup function)
React Redux and Redux Toolkit for state management: App.tsx: /state/store.ts: /state/counter/counterSlice.ts: /pages/CounterPage/index.tsx: React Redux for state management: Redux actions: Redux reducer: Redux store: Counter component: Main App component: Regular React reducer for state management:
3 fundamental FED component types: Stateless, Stateful, and Structural. Stateless Components: Keeping It Simple Stateless components don't manage internal state. They use props to render data, ideal for lightweight scenarios. Stateful Components: Managing Complexity Stateful components handle and maintain internal state, crucial for dynamic content and complex interactions. Structural Components: Building the Foundation Structural components ... Read more
Subtracting an essential element creates unexpected value. In the 1950s, General Mills launched a line of cake mixes under the famous Betty Crocker brand. The cake mixes included all the dry ingredients in the package, plus milk and eggs in powdered form. All you needed was to add water, mix it all together, and stick ... Read more
NLP or Neuro-Linguistic Programming is a behavioral technology, which simply means that it is a set of guiding principles, attitudes, and techniques about real-life behavior. People who uses Neuro-Linguistic Programming: Bill Clinton Barack Obama Tony Blair Roger Stone - main Donald Trump advisor, now facing 40 months jail sentence Alex Jones Tiger Woods J.K. Rowling ... Read more
Many straight guys are averse to exploring their style and how they dress because they think it’s “gay” or intrudes on their masculinity. It makes most men feel uncomfortable. A lot of men feel set in their ways and don’t like the idea of changing the type of shirts they’ve worn, or the haircut they’ve ... Read more
Technique is not being able to juggle a ball 1000 times. Anyone can do that by practicing. Then you can work in the circus. Technique is passing the ball with one touch, with the right speed, at the right foot of your team mate. Someone who has juggled the ball in the air during a ... Read more
The human brain is capable of 1016 processes per second, which makes it far more powerful than any computer currently in existence. But that doesn't mean our brains don't have major limitations. The lowly calculator can do math thousands of times better than we can, and our memories are often less than useless — plus, ... Read more
In the winter of 1928, Joe Kennedy decided to stop to have his shoes shined before he started his day's work at the office. When the boy finished, he offered Kennedy a stock tip: "Buy Hindenburg." Kennedy soon sold off his stocks, thinking: "You know it's time to sell when shoeshine boys give you stock ... Read more