Simplify your SPFx code with react-query

Опубликовано: 15 Май 2023
на канале: Microsoft Community Learning
1,642
15

In this 10-minute developer-focused demo, Marcin Wojciechowski shares the what, why, and how for using React queries. Implement ContextProvider, pass http client to context provider, wrap root component with ContextProvider, implement hook returning useQuery method, and consume your hook in any child component of your context. Tips: use mgwdev-m365-helpers for auto-batching, use pnp.js context in your hook, pass ootb spHttpClient or msGraphClient to ContextProvider, common query reuse, and Use useMutation for posting data!

This PnP Community demo is taken from the Viva Connections & SharePoint Framework Bi-weekly sync call recorded on February 23, 2023.

Demo Presenter
• Marcin Wojciechowski (Valo) | @mgwojciech

Supporting materials
• Article - How to use React hooks with the SharePoint Framework (SPFx) | https://www.voitanos.io/blog/how-to-u...

Learn more
• Microsoft 365 Unified Sample gallery - https://aka.ms/community/samples
• Microsoft 365 Platform Community in YouTube - https://aka.ms/community/videos
• Microsoft 365 Platform Community - http://aka.ms/community/home


На этой странице сайта вы можете посмотреть видео онлайн Simplify your SPFx code with react-query длительностью часов минут секунд в хорошем качестве, которое загрузил пользователь Microsoft Community Learning 15 Май 2023, поделитесь ссылкой с друзьями и знакомыми, на youtube это видео уже посмотрели 1,642 раз и оно понравилось 15 зрителям. Приятного просмотра!