Intro to React Hooks and Context API [Webinar Show Notes]
Live Chat Icon For mobile
Live Chat Icon
Popular Categories.NET  (175).NET Core  (29).NET MAUI  (208)Angular  (109)ASP.NET  (51)ASP.NET Core  (82)ASP.NET MVC  (89)Azure  (41)Black Friday Deal  (1)Blazor  (220)BoldSign  (15)DocIO  (24)Essential JS 2  (107)Essential Studio  (200)File Formats  (67)Flutter  (133)JavaScript  (221)Microsoft  (119)PDF  (81)Python  (1)React  (101)Streamlit  (1)Succinctly series  (131)Syncfusion  (920)TypeScript  (33)Uno Platform  (3)UWP  (4)Vue  (45)Webinar  (51)Windows Forms  (61)WinUI  (68)WPF  (159)Xamarin  (161)XlsIO  (37)Other CategoriesBarcode  (5)BI  (29)Bold BI  (8)Bold Reports  (2)Build conference  (8)Business intelligence  (55)Button  (4)C#  (151)Chart  (132)Cloud  (15)Company  (443)Dashboard  (8)Data Science  (3)Data Validation  (8)DataGrid  (63)Development  (633)Doc  (8)DockingManager  (1)eBook  (99)Enterprise  (22)Entity Framework  (5)Essential Tools  (14)Excel  (41)Extensions  (22)File Manager  (7)Gantt  (18)Gauge  (12)Git  (5)Grid  (31)HTML  (13)Installer  (2)Knockout  (2)Language  (1)LINQPad  (1)Linux  (2)M-Commerce  (1)Metro Studio  (11)Mobile  (508)Mobile MVC  (9)OLAP server  (1)Open source  (1)Orubase  (12)Partners  (21)PDF viewer  (43)Performance  (12)PHP  (2)PivotGrid  (4)Predictive Analytics  (6)Report Server  (3)Reporting  (10)Reporting / Back Office  (11)Rich Text Editor  (12)Road Map  (12)Scheduler  (52)Security  (3)SfDataGrid  (9)Silverlight  (21)Sneak Peek  (31)Solution Services  (4)Spreadsheet  (11)SQL  (11)Stock Chart  (1)Surface  (4)Tablets  (5)Theme  (12)Tips and Tricks  (112)UI  (387)Uncategorized  (68)Unix  (2)User interface  (68)Visual State Manager  (2)Visual Studio  (31)Visual Studio Code  (19)Web  (597)What's new  (333)Windows 8  (19)Windows App  (2)Windows Phone  (15)Windows Phone 7  (9)WinRT  (26)
Intro to React Hooks and Context API [Webinar Show Notes]

Intro to React Hooks and Context API [Webinar Show Notes]

This blog provides the show notes for our October 19, 2023, webinar, “Intro to React Hooks and Context API.” The webinar was presented and hosted by Khalid Abuhakmeh, developer advocate at JetBrains, and Chad Church, senior sales engineer at Syncfusion. If you missed the webinar or would like to watch it again, the recording is on our YouTube page or you can watch it here.

Overview

This webinar covered the basics of React Hooks (useState) and then demonstrated how to use them with Syncfusion controls. It also covers the difference between prop drilling and the Context API while discussing the pros and cons of each.

Time stamps

[00:00] Introduction

[00:55] Overview of React Hooks

[02:00] What is a Hook?

[03:10] Components prior to Hooks

[04:41] Refactored with Hooks

[06:22] Problem solving

[08:30] Benefits

[10:01] Included Hooks

[11:02] Rules of Hooks

[13:02] React useState vs. Context API

[13:36] Demo Start

[36:00] Closing Notes

Q&A

Q: I am from the classic ASP world and just starting in React. Is context comparable to Session variables?

A: The concept is similar.

Q: Which would be cool for isolated editing?

A: You can use it for isolated editing. In the sample, you could just put the context provider in each function or in the immediate parent. But that is not the intention. 

Q: If we’re using the same component in different tree of components, do I understand correctly that context is different in that case? Each tree has its own context?

A: No. Each function will query its parent going up the tree until it finds a parent with the proper context provider.

Q: Is there a way we can get a copy of the code?

A: Yes, I’ve posted it on this GitHub page.

Q: Can you have multiple contexts declared in a single component?

A: Yes.

Q: So, the suggestion is not to use useState for grids and to use useContext so that if the UI is rerendered, it doesn’t affect the useState?

A: State and context Hooks are complementary features of React. You can use one or both depending on your particular use case and the problems you’re attempting to solve.

Q: Is it correct to update the useState or pass the new variable to .dataSource?

A: useState is the proper way to post an update.

Q: Where do you declare the data format for the context?

A: You don’t really have to set a data type or format. JavaScript is way too flexible in this regard.

Summary

During this webinar, we covered an introduction to React Hooks. We hope you enjoyed this webinar and please keep an eye out for our future React webinars. 

Recommended resources (related links)

Tags:

Share this post:

Popular Now

Be the first to get updates

Subscribe RSS feed

Be the first to get updates

Subscribe RSS feed