Using React Hooks in the SharePoint Framework: A Step by Step Guide

Pubblicato il: 03 ottobre 2022
sul canale di: Andrew Connell
9,111
199

I scour all the Microsoft & community resources so YOU DON'T HAVE TO. Save time & stay informed. Each issue contains all the news you need in less than 5 minutes every other Tuesday plus my insights & guidance on a trending topic. Subscribe to my bi-weekly newsletter & join 9,000+ fellow M365 developers! https://vtns.io/ytvnewsletter! No clickbait · 100% free · unsubscribe anytime.

-------------------------------------------

The current version of the Yeoman generator for the #SharePoint Framework (#SPFx) still uses the older-style #React class components. Because that's what you get by default, that's what most developers end up using.

But functional components enabled by React hooks have become widely popular… and I get a lot of questions on how to use React hooks in your #SharePoint projects!

So… until Microsoft updates the Yeoman generator, I'm going to show you how you change your new projects to React hooks in just a few minutes.

And then, I'll show you the basics of hooks with a simple example.


🔗 Read the article ▶️ https://vtns.io/ytvreacthooksspfx


📚 Chapters
-------------------------------------------
00:00 : Introduction
01:00 : What's the problem?
02:08 : Convert a class component to a functional component
03:37 : Implement state & refresh the web part
05:07 : Add button & event handler
07:33 : Add event handler when state property changes
10:21 : Initialize the component with useEffect()

🤓 LEARN MICROSOFT 365 FULL-STACK DEVELOPMENT WITH AC! 👇👇👇

MY FREE MICROSOFT 365 EMAIL & SELF-PACED COURSES
-------------------------------------------
📺 Mastering the SharePoint Framework (Starter Bundle) https://vtns.io/ytvcoursemspfx
✉️ Explore & evaluate the SharePoint Framework https://vtns.io/ytvecourseexplorespfx
✉️ Understand the SharePoint Framework toolchain https://vtns.io/ytvecoursespfxtoolchain
✉️ Microsoft Teams App Development OnRamp https://vtns.io/ytvecoursemsteamsonramp

MY SELF-PACED COURSES
-------------------------------------------
📺 Build Web Parts with the SharePoint Framework (SPFx) https://vtns.io/ytvcoursespfxwp
📺 Extend the SharePoint UX with the SharePoint Framework (SPFx) Extensions https://vtns.io/ytvcoursespfxext
📺 Extend Viva Connections with the SharePoint Framework Adaptive Card Extensions https://vtns.io/ytvcoursespfxace


🔗 RESOURCES
-------------------------------------------
🔗 Want more SPFx? 👉    • START HERE 👉 SharePoint Framework (SPFx)  
🔗 Want more Microsoft Teams app dev? 👉    • START HERE 👉 Microsoft Teams Development  
🔗 Want more Microsoft 365 app dev? 👉    • START HERE 👉 Microsoft 365 Development  


🔗 LINKS
-------------------------------------------
Subscribe to "The Full Stack Dev's Microsoft 365 Playbook" ✉️ https://vtns.io/ytvnewsletter - latest Microsoft 365 news & insights for developers
LinkedIn ▶️   / andrewconnell  
Threads ▶️ https://www.threads.net/@andrewconnell1
GitHub ▶️ https://github.com/andrewconnell & https://github.com/voitanos
𝕏 | Twitter ▶️   / andrewconnell  
https://www.andrewconnell.com/links/
Website ▶️ https://www.voitanos.io/


In questa pagina del sito puoi guardare il video online Using React Hooks in the SharePoint Framework: A Step by Step Guide della durata di ore minuti seconda in buona qualità , che l'utente ha caricato Andrew Connell 03 ottobre 2022, condividi il link con amici e conoscenti, su youtube questo video è già stato visto 9,111 volte e gli è piaciuto 199 spettatori. Buona visione!