distributor
distributor copied to clipboard
Follow react rules of hooks
Description of the Change
Follow react rules of hooks
Closes #1205
How to test the Change
- Start on a test site running WP 6.5 RC 3 and Distributor.
- Edit a post/page, and create a new synced pattern.
- Click on the synced pattern, and then click 'Edit original' in the block toolbar to open the synced pattern in the new editor.
- Make edits and save them -- best I can tell they save fine!
- Click the 'back' button to return to the post/page editor; note that the error displays there initially, too.
Changelog Entry
Fixed - JS synced patterns editor
Credits
Props @kirtangajjar
Checklist:
- [x] I agree to follow this project's Code of Conduct.
- [ ] I have updated the documentation accordingly.
- [ ] I have added tests to cover my change.
- [x] All new and existing tests pass.