use-synchronized-state 1.0.3 → 1.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +1 -1
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -118,7 +118,7 @@ function ChildComponent({ parentState }: { parentState: number }) {
118
118
 
119
119
  // Better: Adjust the state while rendering
120
120
  const [prevState, setPrevState] = useState(parentState);
121
- if (parentState !== prevItems) {
121
+ if (parentState !== prevState) {
122
122
  setPrevState(parentState);
123
123
  setSyncState(parentState);
124
124
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "use-synchronized-state",
3
- "version": "1.0.3",
3
+ "version": "1.0.5",
4
4
  "description": "A React hook that creates a synchronized state with a reactive value in react (fixing the Cascading updates issue)",
5
5
  "author": "rhorge",
6
6
  "license": "MIT",