You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix plugin idempotency issue with React re-renders (#14)
* Fix plugin idempotency issue with React re-renders
- Exclude plugins from deep dependency comparison in useWavesurferInstance
- Track plugins array reference separately to avoid re-initialization on mutation
- Add comprehensive test for plugin re-render behavior
- Update README with detailed plugin memoization examples and requirements
Fixes: katspaugh/wavesurfer.js#3731
* Fix lint error: suppress unused variable warning for plugins destructuring
* Add checks:write and pull-requests:write permissions to workflows
This fixes CI failures caused by missing permissions for GitHub Actions to:
- Create check annotations
- Post PR comments with test results and coverage reports
* Update lint
Copy file name to clipboardExpand all lines: README.md
+98Lines changed: 98 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -91,6 +91,104 @@ const App = () => {
91
91
}
92
92
```
93
93
94
+
## Using plugins
95
+
96
+
Wavesurfer [plugins](https://wavesurfer.xyz/docs/modules/plugins_index) can be passed in the `plugins` option.
97
+
98
+
**Important:** The `plugins` array **must be memoized** using `useMemo` or defined outside the component. This is because wavesurfer.js mutates plugin instances during initialization, and passing a new array on every render will cause errors.
0 commit comments