@TheOfficialSBI@SBICard_Connect@RBI "मैंने ऑनलाइन धोखाधड़ी की घटना को एक घंटे के अंदर एसबीआई कार्ड और स्टेट बैंक को सूचित किया, शिकायत भी दर्ज करवाई, लेकिन कोई मदद नहीं मिली। अब आप यह कह रहे हैं कि ग्राहक ही इस धोखाधड़ी के लिए जिम्मेदार हैं और इसका भुगतान करन होगा।कृपया मदद कर
DAY 3 of #20DaysOfReact
Topics Covered :
1. States
2. Prop drilling
States in React
Imagine you're building a digital thermostat. The "state" in React is like the current temperature displayed on the screen. It's a way for your app to remember and show information that changes over time. For instance, as the room gets warmer or cooler, the displayed temperature updates to show the current temperature.
In React, we use "state" to make sure our app can remember and show changing information like this. It's like a note that React keeps, and whenever something important changes (like the temperature), React takes a look at the note and updates what's displayed on the screen to match.
The state object is where you store property values that belong to the component. Whenever the state object changes, the component re-renders.
useState
When you want to change something on your web page (like updating a score in a game or displaying a new message), you need two things:
Remember the Change: You need a way to remember what you want to change. For instance, if you're playing a game, you need to remember the score.
Make the Change Visible: You also need a way to show the change on your web page. If your score goes up, the web page should update to show the new score.
The useState Hook* in React helps with both of these things:
Memory Box: It gives you a special "memory box" where you can put the thing you want to change (like the score in a game). This box remembers it even when your web page refreshes or updates.
Magic Button: It also gives you a special "magic button" that you can press when you want to make the change visible. When you press this button, React looks in the memory box, sees what's changed, and updates your web page to show the new information. So, if your score goes up, React makes sure the new score is displayed.
Hook.*
[*Hooks are like building blocks in React that allow you to use various features in your web applications. These building blocks can be either pre-made (built-in) by React or custom-made by you by combining them.(We'll discuss about this in detail later)]
Prop Drilling
Think of prop drilling like passing a message along a line of people. Imagine you're playing a game of "telephone" with your friends, and you want to tell the last person in line a secret message. You whisper it to the first person, who whispers it to the next, and so on until it reaches the last person.
"Prop drilling" is a term used in React to describe the process of passing data from a parent component to a deeply nested child component through intermediary components. It can occur when you have a component hierarchy where data needs to be passed down multiple levels.
While prop drilling works, it can lead to several challenges:
Complexity: As your component tree deepens, prop drilling can make your code more complex and harder to maintain.
Performance: Passing props through multiple components, especially when those components don't use the props themselves, can affect performance.
Readability: Code readability can suffer as you pass props through multiple levels of components.
That's it for Day 3! Tomorrow, we'll explore Conditional rendering and Component Lifecycle.
Stay tuned and happy coding! 🚀
Complete Interview Preparation Resources (DSA+DBMS+OS+CN+OOPS+Aptitude) [2023-24] that I & my friends at college are following - a complete thread 🧵
Placements are going & everyone is working hard to get placed. Open this thread & checkout the resources.
(1/n) 👇
@EshaSingh_18 Trust the process. Intern is just the beginning. You still have 20/30 years left.
Come out of the loop of achieving everything in the first go. Circumstances, scenarios change, and its better to accept it.
Remember Dhoni never played U19 WC :)