SlideShare a Scribd company logo
WELCOME TO DUCAT INDIA
Language | Industrial Training | Digital Marketing | Web Technology | Testing+ | Dat
Networking | Mobile Application | ERP | Graphic | Big Data | Cloud Computing
React
Event
7070905090
info@ducatindia.com
React Event
In any web application, typically used to have user interaction. When user
interacts the events start functioning like mouse clicks, mouse hover, and
change event and so on. Application must handle the event and execute the
necessary code. Know more about event handling create functional
component file or functional component using snippet like RFCE. Don’t add
parenthesis after event handler function like “clickHandler” because it is a
function not function call.
When you click the mouse with that click many events occur in code as
follow-:
Following there is components code created for event handling-:
FunctionClick.j
s
So here button is created. The css button is
also created but focus on event only so how it
looks-:
So in above code ‘bgChange’ function is used so that when you click button
the background color will be changed. The function should also be called
above in “const”
So now when button is clicked then it shown in console according to
above written code. To use styling in same file “inline.css” is used.
< div style = {{ backgroundColor: “red”
}}>
If you want to change value of backgroundColor to some other using
state to save previous change then in functional components hooks are
used to write the state.
Const [bg, setBg] = useState();
Above expression is known as array destructuring. Here bg is used to
save state and setBg set updation of state, if you want change color to
purple using states and hooks then it is written as-:
Now new variable is created and in that setBg state is accessed. Now whatever
you will pass the value it will save in “bg”
Now if you want different events or states that is by clicking button some
other button text appears or some emoji you want to add then use
“setState” with respective properties as-:
To add emoji , with “OUCH!! Add emoji name”
Then after clicking it is
shown as-:
THANK YOU
React
Event
7070905090
info@ducatindia.com

More Related Content

What's hot

JavaScript Fetch API
JavaScript Fetch APIJavaScript Fetch API
JavaScript Fetch APIXcat Liu
 
Lets make a better react form
Lets make a better react formLets make a better react form
Lets make a better react formYao Nien Chung
 
Hibernate ppt
Hibernate pptHibernate ppt
Hibernate pptAneega
 
ASP.NET MVC.
ASP.NET MVC.ASP.NET MVC.
ASP.NET MVC.Ni
 
React workshop presentation
React workshop presentationReact workshop presentation
React workshop presentationBojan Golubović
 
CSS3, Media Queries, and Responsive Design
CSS3, Media Queries, and Responsive DesignCSS3, Media Queries, and Responsive Design
CSS3, Media Queries, and Responsive DesignZoe Gillenwater
 
Advanced Javascript
Advanced JavascriptAdvanced Javascript
Advanced JavascriptAdieu
 
How to implement internationalization (i18n) in angular application(multiple ...
How to implement internationalization (i18n) in angular application(multiple ...How to implement internationalization (i18n) in angular application(multiple ...
How to implement internationalization (i18n) in angular application(multiple ...Katy Slemon
 
React JS - A quick introduction tutorial
React JS - A quick introduction tutorialReact JS - A quick introduction tutorial
React JS - A quick introduction tutorialMohammed Fazuluddin
 
An introduction to React.js
An introduction to React.jsAn introduction to React.js
An introduction to React.jsEmanuele DelBono
 

What's hot (20)

JavaScript Fetch API
JavaScript Fetch APIJavaScript Fetch API
JavaScript Fetch API
 
Html forms
Html formsHtml forms
Html forms
 
Jsp ppt
Jsp pptJsp ppt
Jsp ppt
 
Lets make a better react form
Lets make a better react formLets make a better react form
Lets make a better react form
 
Javascript 101
Javascript 101Javascript 101
Javascript 101
 
jQuery for beginners
jQuery for beginnersjQuery for beginners
jQuery for beginners
 
Hibernate ppt
Hibernate pptHibernate ppt
Hibernate ppt
 
Reactjs
Reactjs Reactjs
Reactjs
 
ASP.NET MVC.
ASP.NET MVC.ASP.NET MVC.
ASP.NET MVC.
 
React workshop presentation
React workshop presentationReact workshop presentation
React workshop presentation
 
WEB DEVELOPMENT USING REACT JS
 WEB DEVELOPMENT USING REACT JS WEB DEVELOPMENT USING REACT JS
WEB DEVELOPMENT USING REACT JS
 
jQuery PPT
jQuery PPTjQuery PPT
jQuery PPT
 
CSS3, Media Queries, and Responsive Design
CSS3, Media Queries, and Responsive DesignCSS3, Media Queries, and Responsive Design
CSS3, Media Queries, and Responsive Design
 
Advanced Javascript
Advanced JavascriptAdvanced Javascript
Advanced Javascript
 
How to implement internationalization (i18n) in angular application(multiple ...
How to implement internationalization (i18n) in angular application(multiple ...How to implement internationalization (i18n) in angular application(multiple ...
How to implement internationalization (i18n) in angular application(multiple ...
 
ReactJS presentation.pptx
ReactJS presentation.pptxReactJS presentation.pptx
ReactJS presentation.pptx
 
Javascript
JavascriptJavascript
Javascript
 
React JS - A quick introduction tutorial
React JS - A quick introduction tutorialReact JS - A quick introduction tutorial
React JS - A quick introduction tutorial
 
An introduction to React.js
An introduction to React.jsAn introduction to React.js
An introduction to React.js
 
Jquery
JqueryJquery
Jquery
 

Similar to React event

Cis407 a ilab 1 web application development devry university
Cis407 a ilab 1 web application development devry universityCis407 a ilab 1 web application development devry university
Cis407 a ilab 1 web application development devry universitylhkslkdh89009
 
CSS Disable Button - How to Disable Buttons Using CSS - Blogs
CSS Disable Button - How to Disable Buttons Using CSS - BlogsCSS Disable Button - How to Disable Buttons Using CSS - Blogs
CSS Disable Button - How to Disable Buttons Using CSS - BlogsRonDosh
 
POLITEKNIK MALAYSIA
POLITEKNIK MALAYSIAPOLITEKNIK MALAYSIA
POLITEKNIK MALAYSIAAiman Hud
 
Creating azure logic app for salesforce integration | Webner
Creating azure logic app for salesforce integration | WebnerCreating azure logic app for salesforce integration | Webner
Creating azure logic app for salesforce integration | WebnerChandanWebner
 
Mobile Application Development-Designing User Interface With View
Mobile Application Development-Designing User Interface With ViewMobile Application Development-Designing User Interface With View
Mobile Application Development-Designing User Interface With ViewChandrakantDivate1
 
Google calendar integration in iOS app
Google calendar integration in iOS appGoogle calendar integration in iOS app
Google calendar integration in iOS appKetan Raval
 
Using webblocks for popups in Outsystems Mobile
Using webblocks for popups in Outsystems MobileUsing webblocks for popups in Outsystems Mobile
Using webblocks for popups in Outsystems MobileFrank Boldingh
 
SAP Training ( PS , Material PR , Service PR ,Cost Planning , Budgeting , PO...
SAP Training ( PS , Material PR , Service PR ,Cost Planning , Budgeting ,  PO...SAP Training ( PS , Material PR , Service PR ,Cost Planning , Budgeting ,  PO...
SAP Training ( PS , Material PR , Service PR ,Cost Planning , Budgeting , PO...Soumya De
 
Sap ps training material
Sap ps training materialSap ps training material
Sap ps training materialSoumya De
 
Android tutorials7 calculator
Android tutorials7 calculatorAndroid tutorials7 calculator
Android tutorials7 calculatorVlad Kolesnyk
 
Using prime[31] to connect your unity game to azure mobile services
Using prime[31] to connect your unity game to azure mobile servicesUsing prime[31] to connect your unity game to azure mobile services
Using prime[31] to connect your unity game to azure mobile servicesDavid Voyles
 
Cis 407 i lab 1 of 7
Cis 407 i lab 1 of 7Cis 407 i lab 1 of 7
Cis 407 i lab 1 of 7helpido9
 
MAD mobile application development you can learn from here , we perform all c...
MAD mobile application development you can learn from here , we perform all c...MAD mobile application development you can learn from here , we perform all c...
MAD mobile application development you can learn from here , we perform all c...harshalpatil183931
 
Jetpack Compose - A Lightning Tour
Jetpack Compose - A Lightning TourJetpack Compose - A Lightning Tour
Jetpack Compose - A Lightning TourMatthew Clarke
 
How Create an Animated Web Banner with InDesign & in5
How Create an Animated Web Banner with InDesign & in5How Create an Animated Web Banner with InDesign & in5
How Create an Animated Web Banner with InDesign & in5Justin Putney
 

Similar to React event (20)

Ppt lesson 03
Ppt lesson 03Ppt lesson 03
Ppt lesson 03
 
Cis407 a ilab 1 web application development devry university
Cis407 a ilab 1 web application development devry universityCis407 a ilab 1 web application development devry university
Cis407 a ilab 1 web application development devry university
 
CSS Disable Button - How to Disable Buttons Using CSS - Blogs
CSS Disable Button - How to Disable Buttons Using CSS - BlogsCSS Disable Button - How to Disable Buttons Using CSS - Blogs
CSS Disable Button - How to Disable Buttons Using CSS - Blogs
 
POLITEKNIK MALAYSIA
POLITEKNIK MALAYSIAPOLITEKNIK MALAYSIA
POLITEKNIK MALAYSIA
 
Creating azure logic app for salesforce integration | Webner
Creating azure logic app for salesforce integration | WebnerCreating azure logic app for salesforce integration | Webner
Creating azure logic app for salesforce integration | Webner
 
Mobile Application Development-Designing User Interface With View
Mobile Application Development-Designing User Interface With ViewMobile Application Development-Designing User Interface With View
Mobile Application Development-Designing User Interface With View
 
Google calendar integration in iOS app
Google calendar integration in iOS appGoogle calendar integration in iOS app
Google calendar integration in iOS app
 
Given When Then
Given When ThenGiven When Then
Given When Then
 
Using webblocks for popups in Outsystems Mobile
Using webblocks for popups in Outsystems MobileUsing webblocks for popups in Outsystems Mobile
Using webblocks for popups in Outsystems Mobile
 
SAP Training ( PS , Material PR , Service PR ,Cost Planning , Budgeting , PO...
SAP Training ( PS , Material PR , Service PR ,Cost Planning , Budgeting ,  PO...SAP Training ( PS , Material PR , Service PR ,Cost Planning , Budgeting ,  PO...
SAP Training ( PS , Material PR , Service PR ,Cost Planning , Budgeting , PO...
 
Sap ps training material
Sap ps training materialSap ps training material
Sap ps training material
 
Android tutorials7 calculator
Android tutorials7 calculatorAndroid tutorials7 calculator
Android tutorials7 calculator
 
Using prime[31] to connect your unity game to azure mobile services
Using prime[31] to connect your unity game to azure mobile servicesUsing prime[31] to connect your unity game to azure mobile services
Using prime[31] to connect your unity game to azure mobile services
 
Cis 407 i lab 1 of 7
Cis 407 i lab 1 of 7Cis 407 i lab 1 of 7
Cis 407 i lab 1 of 7
 
MAD mobile application development you can learn from here , we perform all c...
MAD mobile application development you can learn from here , we perform all c...MAD mobile application development you can learn from here , we perform all c...
MAD mobile application development you can learn from here , we perform all c...
 
Dojo1.0_Tutorials
Dojo1.0_TutorialsDojo1.0_Tutorials
Dojo1.0_Tutorials
 
Dojo1.0_Tutorials
Dojo1.0_TutorialsDojo1.0_Tutorials
Dojo1.0_Tutorials
 
Jetpack Compose - A Lightning Tour
Jetpack Compose - A Lightning TourJetpack Compose - A Lightning Tour
Jetpack Compose - A Lightning Tour
 
Mca 504 dotnet_unit5
Mca 504 dotnet_unit5Mca 504 dotnet_unit5
Mca 504 dotnet_unit5
 
How Create an Animated Web Banner with InDesign & in5
How Create an Animated Web Banner with InDesign & in5How Create an Animated Web Banner with InDesign & in5
How Create an Animated Web Banner with InDesign & in5
 

More from Ducat

Dot net training institute
Dot net training instituteDot net training institute
Dot net training instituteDucat
 
Mis certification
Mis certificationMis certification
Mis certificationDucat
 
Devops certification
Devops certificationDevops certification
Devops certificationDucat
 
Best ethical hacking course online
Best ethical hacking course onlineBest ethical hacking course online
Best ethical hacking course onlineDucat
 
React js training course in noida
React js training course in noidaReact js training course in noida
React js training course in noidaDucat
 
Java for beginners
Java for beginnersJava for beginners
Java for beginnersDucat
 
Benfits of python
Benfits of pythonBenfits of python
Benfits of pythonDucat
 
Interactive reports development
Interactive reports developmentInteractive reports development
Interactive reports developmentDucat
 
Abap report
Abap reportAbap report
Abap reportDucat
 
Sap abap database table
Sap abap database tableSap abap database table
Sap abap database tableDucat
 
Sap s4 hana saps next generation business suite
Sap s4 hana saps next generation business suiteSap s4 hana saps next generation business suite
Sap s4 hana saps next generation business suiteDucat
 
Connect dashboard designer
Connect dashboard designerConnect dashboard designer
Connect dashboard designerDucat
 
Major components of sap hana
Major components of sap hanaMajor components of sap hana
Major components of sap hanaDucat
 
Schema in sap hana
Schema in sap hanaSchema in sap hana
Schema in sap hanaDucat
 
Sap hana attribute view
Sap hana attribute viewSap hana attribute view
Sap hana attribute viewDucat
 
Sap hana studio administration console
Sap hana studio administration consoleSap hana studio administration console
Sap hana studio administration consoleDucat
 
What is ebs
What is ebsWhat is ebs
What is ebsDucat
 
Introduction to mern
Introduction to mernIntroduction to mern
Introduction to mernDucat
 
Selenium tutorials
Selenium tutorialsSelenium tutorials
Selenium tutorialsDucat
 
Waits alerts and switch windows
Waits alerts and switch windowsWaits alerts and switch windows
Waits alerts and switch windowsDucat
 

More from Ducat (20)

Dot net training institute
Dot net training instituteDot net training institute
Dot net training institute
 
Mis certification
Mis certificationMis certification
Mis certification
 
Devops certification
Devops certificationDevops certification
Devops certification
 
Best ethical hacking course online
Best ethical hacking course onlineBest ethical hacking course online
Best ethical hacking course online
 
React js training course in noida
React js training course in noidaReact js training course in noida
React js training course in noida
 
Java for beginners
Java for beginnersJava for beginners
Java for beginners
 
Benfits of python
Benfits of pythonBenfits of python
Benfits of python
 
Interactive reports development
Interactive reports developmentInteractive reports development
Interactive reports development
 
Abap report
Abap reportAbap report
Abap report
 
Sap abap database table
Sap abap database tableSap abap database table
Sap abap database table
 
Sap s4 hana saps next generation business suite
Sap s4 hana saps next generation business suiteSap s4 hana saps next generation business suite
Sap s4 hana saps next generation business suite
 
Connect dashboard designer
Connect dashboard designerConnect dashboard designer
Connect dashboard designer
 
Major components of sap hana
Major components of sap hanaMajor components of sap hana
Major components of sap hana
 
Schema in sap hana
Schema in sap hanaSchema in sap hana
Schema in sap hana
 
Sap hana attribute view
Sap hana attribute viewSap hana attribute view
Sap hana attribute view
 
Sap hana studio administration console
Sap hana studio administration consoleSap hana studio administration console
Sap hana studio administration console
 
What is ebs
What is ebsWhat is ebs
What is ebs
 
Introduction to mern
Introduction to mernIntroduction to mern
Introduction to mern
 
Selenium tutorials
Selenium tutorialsSelenium tutorials
Selenium tutorials
 
Waits alerts and switch windows
Waits alerts and switch windowsWaits alerts and switch windows
Waits alerts and switch windows
 

Recently uploaded

Keeping Your Information Safe with Centralized Security Services
Keeping Your Information Safe with Centralized Security ServicesKeeping Your Information Safe with Centralized Security Services
Keeping Your Information Safe with Centralized Security ServicesTechSoup
 
2024_Student Session 2_ Set Plan Preparation.pptx
2024_Student Session 2_ Set Plan Preparation.pptx2024_Student Session 2_ Set Plan Preparation.pptx
2024_Student Session 2_ Set Plan Preparation.pptxmansk2
 
The Last Leaf, a short story by O. Henry
The Last Leaf, a short story by O. HenryThe Last Leaf, a short story by O. Henry
The Last Leaf, a short story by O. HenryEugene Lysak
 
PART A. Introduction to Costumer Service
PART A. Introduction to Costumer ServicePART A. Introduction to Costumer Service
PART A. Introduction to Costumer ServicePedroFerreira53928
 
Basic phrases for greeting and assisting costumers
Basic phrases for greeting and assisting costumersBasic phrases for greeting and assisting costumers
Basic phrases for greeting and assisting costumersPedroFerreira53928
 
MARUTI SUZUKI- A Successful Joint Venture in India.pptx
MARUTI SUZUKI- A Successful Joint Venture in India.pptxMARUTI SUZUKI- A Successful Joint Venture in India.pptx
MARUTI SUZUKI- A Successful Joint Venture in India.pptxbennyroshan06
 
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXXPhrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXXMIRIAMSALINAS13
 
Danh sách HSG Bộ môn cấp trường - Cấp THPT.pdf
Danh sách HSG Bộ môn cấp trường - Cấp THPT.pdfDanh sách HSG Bộ môn cấp trường - Cấp THPT.pdf
Danh sách HSG Bộ môn cấp trường - Cấp THPT.pdfQucHHunhnh
 
50 ĐỀ LUYỆN THI IOE LỚP 9 - NĂM HỌC 2022-2023 (CÓ LINK HÌNH, FILE AUDIO VÀ ĐÁ...
50 ĐỀ LUYỆN THI IOE LỚP 9 - NĂM HỌC 2022-2023 (CÓ LINK HÌNH, FILE AUDIO VÀ ĐÁ...50 ĐỀ LUYỆN THI IOE LỚP 9 - NĂM HỌC 2022-2023 (CÓ LINK HÌNH, FILE AUDIO VÀ ĐÁ...
50 ĐỀ LUYỆN THI IOE LỚP 9 - NĂM HỌC 2022-2023 (CÓ LINK HÌNH, FILE AUDIO VÀ ĐÁ...Nguyen Thanh Tu Collection
 
Gyanartha SciBizTech Quiz slideshare.pptx
Gyanartha SciBizTech Quiz slideshare.pptxGyanartha SciBizTech Quiz slideshare.pptx
Gyanartha SciBizTech Quiz slideshare.pptxShibin Azad
 
Sectors of the Indian Economy - Class 10 Study Notes pdf
Sectors of the Indian Economy - Class 10 Study Notes pdfSectors of the Indian Economy - Class 10 Study Notes pdf
Sectors of the Indian Economy - Class 10 Study Notes pdfVivekanand Anglo Vedic Academy
 
Basic Civil Engineering Notes of Chapter-6, Topic- Ecosystem, Biodiversity G...
Basic Civil Engineering Notes of Chapter-6,  Topic- Ecosystem, Biodiversity G...Basic Civil Engineering Notes of Chapter-6,  Topic- Ecosystem, Biodiversity G...
Basic Civil Engineering Notes of Chapter-6, Topic- Ecosystem, Biodiversity G...Denish Jangid
 
Jose-Rizal-and-Philippine-Nationalism-National-Symbol-2.pptx
Jose-Rizal-and-Philippine-Nationalism-National-Symbol-2.pptxJose-Rizal-and-Philippine-Nationalism-National-Symbol-2.pptx
Jose-Rizal-and-Philippine-Nationalism-National-Symbol-2.pptxricssacare
 
Instructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptxInstructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptxJheel Barad
 
How to Create Map Views in the Odoo 17 ERP
How to Create Map Views in the Odoo 17 ERPHow to Create Map Views in the Odoo 17 ERP
How to Create Map Views in the Odoo 17 ERPCeline George
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaasiemaillard
 
Telling Your Story_ Simple Steps to Build Your Nonprofit's Brand Webinar.pdf
Telling Your Story_ Simple Steps to Build Your Nonprofit's Brand Webinar.pdfTelling Your Story_ Simple Steps to Build Your Nonprofit's Brand Webinar.pdf
Telling Your Story_ Simple Steps to Build Your Nonprofit's Brand Webinar.pdfTechSoup
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaasiemaillard
 
Application of Matrices in real life. Presentation on application of matrices
Application of Matrices in real life. Presentation on application of matricesApplication of Matrices in real life. Presentation on application of matrices
Application of Matrices in real life. Presentation on application of matricesRased Khan
 

Recently uploaded (20)

Keeping Your Information Safe with Centralized Security Services
Keeping Your Information Safe with Centralized Security ServicesKeeping Your Information Safe with Centralized Security Services
Keeping Your Information Safe with Centralized Security Services
 
2024_Student Session 2_ Set Plan Preparation.pptx
2024_Student Session 2_ Set Plan Preparation.pptx2024_Student Session 2_ Set Plan Preparation.pptx
2024_Student Session 2_ Set Plan Preparation.pptx
 
The Last Leaf, a short story by O. Henry
The Last Leaf, a short story by O. HenryThe Last Leaf, a short story by O. Henry
The Last Leaf, a short story by O. Henry
 
PART A. Introduction to Costumer Service
PART A. Introduction to Costumer ServicePART A. Introduction to Costumer Service
PART A. Introduction to Costumer Service
 
Basic phrases for greeting and assisting costumers
Basic phrases for greeting and assisting costumersBasic phrases for greeting and assisting costumers
Basic phrases for greeting and assisting costumers
 
MARUTI SUZUKI- A Successful Joint Venture in India.pptx
MARUTI SUZUKI- A Successful Joint Venture in India.pptxMARUTI SUZUKI- A Successful Joint Venture in India.pptx
MARUTI SUZUKI- A Successful Joint Venture in India.pptx
 
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXXPhrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
 
Danh sách HSG Bộ môn cấp trường - Cấp THPT.pdf
Danh sách HSG Bộ môn cấp trường - Cấp THPT.pdfDanh sách HSG Bộ môn cấp trường - Cấp THPT.pdf
Danh sách HSG Bộ môn cấp trường - Cấp THPT.pdf
 
Operations Management - Book1.p - Dr. Abdulfatah A. Salem
Operations Management - Book1.p  - Dr. Abdulfatah A. SalemOperations Management - Book1.p  - Dr. Abdulfatah A. Salem
Operations Management - Book1.p - Dr. Abdulfatah A. Salem
 
50 ĐỀ LUYỆN THI IOE LỚP 9 - NĂM HỌC 2022-2023 (CÓ LINK HÌNH, FILE AUDIO VÀ ĐÁ...
50 ĐỀ LUYỆN THI IOE LỚP 9 - NĂM HỌC 2022-2023 (CÓ LINK HÌNH, FILE AUDIO VÀ ĐÁ...50 ĐỀ LUYỆN THI IOE LỚP 9 - NĂM HỌC 2022-2023 (CÓ LINK HÌNH, FILE AUDIO VÀ ĐÁ...
50 ĐỀ LUYỆN THI IOE LỚP 9 - NĂM HỌC 2022-2023 (CÓ LINK HÌNH, FILE AUDIO VÀ ĐÁ...
 
Gyanartha SciBizTech Quiz slideshare.pptx
Gyanartha SciBizTech Quiz slideshare.pptxGyanartha SciBizTech Quiz slideshare.pptx
Gyanartha SciBizTech Quiz slideshare.pptx
 
Sectors of the Indian Economy - Class 10 Study Notes pdf
Sectors of the Indian Economy - Class 10 Study Notes pdfSectors of the Indian Economy - Class 10 Study Notes pdf
Sectors of the Indian Economy - Class 10 Study Notes pdf
 
Basic Civil Engineering Notes of Chapter-6, Topic- Ecosystem, Biodiversity G...
Basic Civil Engineering Notes of Chapter-6,  Topic- Ecosystem, Biodiversity G...Basic Civil Engineering Notes of Chapter-6,  Topic- Ecosystem, Biodiversity G...
Basic Civil Engineering Notes of Chapter-6, Topic- Ecosystem, Biodiversity G...
 
Jose-Rizal-and-Philippine-Nationalism-National-Symbol-2.pptx
Jose-Rizal-and-Philippine-Nationalism-National-Symbol-2.pptxJose-Rizal-and-Philippine-Nationalism-National-Symbol-2.pptx
Jose-Rizal-and-Philippine-Nationalism-National-Symbol-2.pptx
 
Instructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptxInstructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptx
 
How to Create Map Views in the Odoo 17 ERP
How to Create Map Views in the Odoo 17 ERPHow to Create Map Views in the Odoo 17 ERP
How to Create Map Views in the Odoo 17 ERP
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
 
Telling Your Story_ Simple Steps to Build Your Nonprofit's Brand Webinar.pdf
Telling Your Story_ Simple Steps to Build Your Nonprofit's Brand Webinar.pdfTelling Your Story_ Simple Steps to Build Your Nonprofit's Brand Webinar.pdf
Telling Your Story_ Simple Steps to Build Your Nonprofit's Brand Webinar.pdf
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
 
Application of Matrices in real life. Presentation on application of matrices
Application of Matrices in real life. Presentation on application of matricesApplication of Matrices in real life. Presentation on application of matrices
Application of Matrices in real life. Presentation on application of matrices
 

React event

  • 1. WELCOME TO DUCAT INDIA Language | Industrial Training | Digital Marketing | Web Technology | Testing+ | Dat Networking | Mobile Application | ERP | Graphic | Big Data | Cloud Computing React Event 7070905090 info@ducatindia.com
  • 2. React Event In any web application, typically used to have user interaction. When user interacts the events start functioning like mouse clicks, mouse hover, and change event and so on. Application must handle the event and execute the necessary code. Know more about event handling create functional component file or functional component using snippet like RFCE. Don’t add parenthesis after event handler function like “clickHandler” because it is a function not function call. When you click the mouse with that click many events occur in code as follow-: Following there is components code created for event handling-:
  • 4. So here button is created. The css button is also created but focus on event only so how it looks-:
  • 5. So in above code ‘bgChange’ function is used so that when you click button the background color will be changed. The function should also be called above in “const”
  • 6. So now when button is clicked then it shown in console according to above written code. To use styling in same file “inline.css” is used. < div style = {{ backgroundColor: “red” }}> If you want to change value of backgroundColor to some other using state to save previous change then in functional components hooks are used to write the state. Const [bg, setBg] = useState(); Above expression is known as array destructuring. Here bg is used to save state and setBg set updation of state, if you want change color to purple using states and hooks then it is written as-:
  • 7. Now new variable is created and in that setBg state is accessed. Now whatever you will pass the value it will save in “bg”
  • 8. Now if you want different events or states that is by clicking button some other button text appears or some emoji you want to add then use “setState” with respective properties as-: To add emoji , with “OUCH!! Add emoji name”
  • 9. Then after clicking it is shown as-: