evermade / wp-block-toolkit

Toolkit for developing WordPress Gutenberg blocks.
https://www.evermade.fi
GNU General Public License v3.0
9 stars 1 forks source link

PostSearchControl breaks if post type does not exist #7

Open mirasusanna opened 1 year ago

mirasusanna commented 1 year ago

This might be a non-issue really but wanted to report anyway.

I made a goddamn typo in PostSearchControl type prop (mistook a dash for underscore in cpt name) and it took me way too long to figure our where the issue was. The component just seems to get stuck in this infinite loop of searching for posts in nonexistent post type without any errors. Maybe it could be useful in usePostSearch to check if the props are valid?

image