Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add new React sample showcasing the use of the useReducer hook for state management #5385

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

ahmad-jad-alhak
Copy link

@ahmad-jad-alhak ahmad-jad-alhak commented Jan 25, 2025

  • New sample
  • Bug fix/update
  • Related issues: fixes #X, partially #Y, mentioned in #Z

What's in this Pull Request?

Please describe the changes in this PR. Sample description or details around bugs which are being fixed.

This Pull Request introduces a new web part designed to demonstrate the effective use of the React useReducer hook over use state in complex projects alongside the PnPjs library for fetching data from a SharePoint list. Below is a detailed breakdown of the changes included:

Using react useReducer hook for SPFx projects
Utilized for managing complex component state.
Improves state handling for asynchronous data fetching.
Simplifies handling of loading states, error management, and updates to fetched data.

Node Version

18.19.1 or higher

Node version used:
18.19.1

Checklist

  • My pull request affects only ONE sample.
  • My sample builds without any warnings
  • I have updated the README.md file's Version history. For new samples, created a new README.md file matching this template
  • My README.md has at least one static high-resolution screenshot (i.e. not a GIF) located in the assets folder.
  • My README.md contains complete setup instructions, including pre-requisites and permissions required
  • My solution includes a .nvmrc file indicating the version of Node.js

@ahmad-jad-alhak ahmad-jad-alhak changed the title React use reducer hook add new React sample showcasing the use of the useReducer hook for state management Jan 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants