This repo contains skeleton code and the folder structure that is used for useContext and useReducer in SPFx webpart. By doing this, you can implement global in your app which makes easy to update and grab states.
You can refer to this article for detailed explanation of code used in this repo -> (https://www.sharepointpals.com/post/skeleton-code-for-global-state-management-using-usecontext-usereducer-in-spfx-solution)
Get your own free development tenant by subscribing to Microsoft 365 developer program
Any special pre-requisites?
Solution | Author(s) |
---|---|
GlobalStateSkeleton | (Fazil, twitter: @AhamedFazilB) |
Version | Date | Comments |
---|---|---|
1.0 | March 13, 2021 | Initial release |
THIS CODE IS PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
- Clone this repository
- Ensure that you are at the solution folder
- in the command-line run:
- npm install
- gulp serve
Include any additional steps as needed.
- Getting started with SharePoint Framework
- Building for Microsoft teams
- Use Microsoft Graph in your solution
- Publish SharePoint Framework applications to the Marketplace
- Microsoft 365 Patterns and Practices - Guidance, tooling, samples and open-source controls for your Microsoft 365 development
- React - About useContext, useReducer
- Immer - For easy state management, useful for complex nested objects, arrays in your state