What if you need to manage more complex states? Here useReducers comes into play
React Hooks are so powerful and especially some additional hooks.
Do you know there is an alternative to useState called useReducer hook? It is used to manage more complex states.
Let's look into detail 🧵👇🏻
What if you need to manage more complex states? Here useReducers comes into play
The second value is a dispatch function using which we can update our state.
Here is the complete syntax 👇🏻
I just implemented a basic code here. Basically, I am calling dispatch function on button click which will eventually call reducer function
Before that one thing to note here is that useReducer is for handling more complex states hence it is recommended to passing the current state as an object
Something like this 👇🏻
Play around with it here: https://t.co/6BlaBeul1U
Here is "payload" comes into play. It is used to pass the value which represents the payloads of the action.
For example, suppose I want to pass "temp" variable 👇🏻
https://t.co/6BlaBeul1U
Check out the code and try to play around with it for better understanding.
https://t.co/TCPEn0W3Pz
Check it out: https://t.co/nt4hZzInIR
More from Pratham
If you start with the right course then the process becomes a little easier
I found some amazing YouTube videos and courses that will help you start your Web Development journey
🧵👇🏻
HTML and CSS
- A great way to arouse your web dev journey with Gary's (@designcoursecom) course on YouTube
🔗 https://t.co/xjm7nfV2L2
JavaScript
- Although it's impossible to learn JavaScript in 2 hours but JavaScript mastery is one the best YouTube chanel for JavaScript. This 2 hours long crash course will help you start your journey and gives you quick overview.
🔗 https://t.co/1zcSeu4zKE
Git and GitHub
Git is an essential tool. And after learning JavaScript, I think one should go for Git and GitHub. Check out this free great course on Udemy
🔗 https://t.co/E14cibOLXb
React
What you'll learn
- what problems React can solve
- how React solves those problems under the hood
- what JSX is and how it translates to regular JavaScript function calls and objects
- manage state with hooks
- build forms
🔗 https://t.co/3z22aeVQFc
I found some amazing YouTube videos and courses that will help you start your Web Development journey
🧵👇🏻
HTML and CSS
- A great way to arouse your web dev journey with Gary's (@designcoursecom) course on YouTube
🔗 https://t.co/xjm7nfV2L2
JavaScript
- Although it's impossible to learn JavaScript in 2 hours but JavaScript mastery is one the best YouTube chanel for JavaScript. This 2 hours long crash course will help you start your journey and gives you quick overview.
🔗 https://t.co/1zcSeu4zKE
Git and GitHub
Git is an essential tool. And after learning JavaScript, I think one should go for Git and GitHub. Check out this free great course on Udemy
🔗 https://t.co/E14cibOLXb
React
What you'll learn
- what problems React can solve
- how React solves those problems under the hood
- what JSX is and how it translates to regular JavaScript function calls and objects
- manage state with hooks
- build forms
🔗 https://t.co/3z22aeVQFc
7 amazing websites that will help you improve your CSS skills
🧵👇
1️⃣ Learn to code HTML and CSS
- Learn how to build beautiful and intuitive websites by way of clear and organized lessons
🖇️ https://t.co/bl2rx2q8vk
2️⃣ CSS reference
- CSS Reference is a free visual guide to CSS. It features the most popular properties, and explains them with illustrated and animated content
🖇️ https://t.co/XAlj33g1Zk
3️⃣ CSS tutorial
- These tutorials on web design & CSS makes learning this stuff fun and easy
🖇️ https://t.co/y9vAj6fMGk
4️⃣ CSS Layouts
- This site teaches the CSS fundamentals that are used in any website's layout.
🖇️ https://t.co/n4EGLScpDF
🧵👇
1️⃣ Learn to code HTML and CSS
- Learn how to build beautiful and intuitive websites by way of clear and organized lessons
🖇️ https://t.co/bl2rx2q8vk
2️⃣ CSS reference
- CSS Reference is a free visual guide to CSS. It features the most popular properties, and explains them with illustrated and animated content
🖇️ https://t.co/XAlj33g1Zk
3️⃣ CSS tutorial
- These tutorials on web design & CSS makes learning this stuff fun and easy
🖇️ https://t.co/y9vAj6fMGk
4️⃣ CSS Layouts
- This site teaches the CSS fundamentals that are used in any website's layout.
🖇️ https://t.co/n4EGLScpDF
A complete beginner's guide to styling your website with CSS.
Thread 🧵👇🏻
CSS is an amazing and unique language that servers a great purpose. We can make our website visually good using CSS. It describe the presentation of web pages, including typography,. layouts, color etc...
{ 2 / 27 }
First and foremost
The characterstic of a great website is it's color scheme. Forget about everything and learn about background and color properties initially.
The colors are something from which users interact first whenever they visit your webpage
{ 3 / 27 }
There are a lot of great color palette out there using which you can generate pleasant color schemes
Check this great tool for generating accessible colors
https://t.co/ndsgBaMv2M
{ 4 / 27 }
Don't think that background property is just for setting the solid color. Background is a shorthand property for background-image, background-position etc..
{ 5 / 27 }
Thread 🧵👇🏻
CSS is an amazing and unique language that servers a great purpose. We can make our website visually good using CSS. It describe the presentation of web pages, including typography,. layouts, color etc...
{ 2 / 27 }
First and foremost
The characterstic of a great website is it's color scheme. Forget about everything and learn about background and color properties initially.
The colors are something from which users interact first whenever they visit your webpage
{ 3 / 27 }
There are a lot of great color palette out there using which you can generate pleasant color schemes
Check this great tool for generating accessible colors
https://t.co/ndsgBaMv2M
{ 4 / 27 }
Don't think that background property is just for setting the solid color. Background is a shorthand property for background-image, background-position etc..
{ 5 / 27 }
Five free VS Code extensions that will change the way you do web development:
1. RapidAPI Client
Fulfill all your need for API development.
• Test and consume APIs
• Work with your VS Code theme
• Generate TypeScript, Swift, and Python interfaces from responses.
🔗 https://t.co/FR0QhyTi8v
2. Better Comments
Create more human-friendly comments in your code.
• Alerts
• Queries
• TODOs
• Highlights
🔗 https://t.co/AV2BwAMAlL
3. Git Graph
View a Git Graph of your repository and efficiently perform Git actions from the graph.
🔗 https://t.co/S5wagmTgsa
4. Peacock
Do you have a habit of keeping multiple VS Code windows open?
Peacock lets you change the color of your VS code even if multiple instances are open.
🔗 https://t.co/bmidPkTQOK
1. RapidAPI Client
Fulfill all your need for API development.
• Test and consume APIs
• Work with your VS Code theme
• Generate TypeScript, Swift, and Python interfaces from responses.
🔗 https://t.co/FR0QhyTi8v
2. Better Comments
Create more human-friendly comments in your code.
• Alerts
• Queries
• TODOs
• Highlights
🔗 https://t.co/AV2BwAMAlL
3. Git Graph
View a Git Graph of your repository and efficiently perform Git actions from the graph.
🔗 https://t.co/S5wagmTgsa
4. Peacock
Do you have a habit of keeping multiple VS Code windows open?
Peacock lets you change the color of your VS code even if multiple instances are open.
🔗 https://t.co/bmidPkTQOK
APIs in general are so powerful.
Best 5 public APIs you can use to build your next project:
1. Number Verification API
A RESTful JSON API for national and international phone number validation.
🔗 https://t.co/fzBmCMFdIj
2. OpenAI API
ChatGPT is an outstanding tool. Build your own API applications with OpenAI API.
🔗 https://t.co/TVnTciMpML
3. Currency Data API
Currency Data API provides a simple REST API with real-time and historical exchange rates for 168 world currencies
🔗 https://t.co/TRj35IUUec
4. Weather API
Real-Time & historical world weather data API.
Retrieve instant, accurate weather information for
any location in the world in lightweight JSON format.
🔗 https://t.co/DCY8kXqVIK
Best 5 public APIs you can use to build your next project:
1. Number Verification API
A RESTful JSON API for national and international phone number validation.
🔗 https://t.co/fzBmCMFdIj
2. OpenAI API
ChatGPT is an outstanding tool. Build your own API applications with OpenAI API.
🔗 https://t.co/TVnTciMpML
3. Currency Data API
Currency Data API provides a simple REST API with real-time and historical exchange rates for 168 world currencies
🔗 https://t.co/TRj35IUUec
4. Weather API
Real-Time & historical world weather data API.
Retrieve instant, accurate weather information for
any location in the world in lightweight JSON format.
🔗 https://t.co/DCY8kXqVIK
You May Also Like
The first area to focus on is diversity. This has become a dogma in the tech world, and despite the fact that tech is one of the most meritocratic industries in the world, there are constant efforts to promote diversity at the expense of fairness, merit and competency. Examples:
USC's Interactive Media & Games Division cancels all-star panel that included top-tier game developers who were invited to share their experiences with students. Why? Because there were no women on the
ElectronConf is a conf which chooses presenters based on blind auditions; the identity, gender, and race of the speaker is not known to the selection team. The results of that merit-based approach was an all-male panel. So they cancelled the conference.
Apple's head of diversity (a black woman) got in trouble for promoting a vision of diversity that is at odds with contemporary progressive dogma. (She left the company shortly after this
Also in the name of diversity, there is unabashed discrimination against men (especially white men) in tech, in both hiring policies and in other arenas. One such example is this, a developer workshop that specifically excluded men: https://t.co/N0SkH4hR35
USC's Interactive Media & Games Division cancels all-star panel that included top-tier game developers who were invited to share their experiences with students. Why? Because there were no women on the
ElectronConf is a conf which chooses presenters based on blind auditions; the identity, gender, and race of the speaker is not known to the selection team. The results of that merit-based approach was an all-male panel. So they cancelled the conference.
Apple's head of diversity (a black woman) got in trouble for promoting a vision of diversity that is at odds with contemporary progressive dogma. (She left the company shortly after this
Also in the name of diversity, there is unabashed discrimination against men (especially white men) in tech, in both hiring policies and in other arenas. One such example is this, a developer workshop that specifically excluded men: https://t.co/N0SkH4hR35