I am using Gutenberg's withSelect package to try to get all of the post types belonging to the site. Here is my code:
export default withSelect( select => {
// shorthand
const { getEntityRecords } = select( 'core' );
return {
typesList: getEntityRecords( 'types', '' ),
};
} )( SearchEdit );
But I am not getting anything back. I also found the documentation for withSelect very sparse so if anyone has any further information that would be great and I will try to update the docs.