10up / distributor

Share content between your websites.
https://distributorplugin.com
GNU General Public License v2.0
633 stars 153 forks source link

Follow react rules of hooks #1228

Closed kirtangajjar closed 2 months ago

kirtangajjar commented 3 months ago

Description of the Change

Follow react rules of hooks

Closes #1205

How to test the Change

  1. Start on a test site running WP 6.5 RC 3 and Distributor.
  2. Edit a post/page, and create a new synced pattern.
  3. Click on the synced pattern, and then click 'Edit original' in the block toolbar to open the synced pattern in the new editor.
  4. Make edits and save them -- best I can tell they save fine!
  5. 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: