Skip to content

Commit

Permalink
Interactivity API: Prevent calling proxifyContext over an already-p…
Browse files Browse the repository at this point in the history
…roxified context inside the `wp-context` directive (#65090)

* Do not store the proxified context inside  `currentValue.current`.

* Update changelog

Co-authored-by: DAreRodz <[email protected]>
Co-authored-by: gziolo <[email protected]>
  • Loading branch information
3 people authored Sep 5, 2024
1 parent bc96d19 commit e40447e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 4 additions & 0 deletions packages/interactivity/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## Unreleased

### Bug Fixes

- Prevent calling `proxifyContext` over an already-proxified context inside `wp-context` ([#65090](https://github.com/WordPress/gutenberg/pull/65090)).

## 6.7.0 (2024-09-05)

### Enhancements
Expand Down
3 changes: 1 addition & 2 deletions packages/interactivity/src/directives.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -290,11 +290,10 @@ export default () => {
currentValue.current,
deepClone( value ) as object
);
currentValue.current = proxifyContext(
result[ namespace ] = proxifyContext(
currentValue.current,
inheritedValue[ namespace ]
);
result[ namespace ] = currentValue.current;
}
return result;
}, [ defaultEntry, inheritedValue ] );
Expand Down

0 comments on commit e40447e

Please sign in to comment.