Skip to content

Commit 40584db

Browse files
moreira-devahmadawais
authored andcommitted
📦 NEW: External @wordpress/api-fetch
Allows using the external wp.apiFetch method. Otherwise, if you try to import it from the @wordpress/api-fetch package, it won't have the REST API base URL initialized. Example of usage: import apiFetch from '@wordpress/api-fetch'; apiFetch( { path: '/wp/v2/posts' } ).then( posts => { console.log( posts ); } );
1 parent 715dd8d commit 40584db

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

packages/cgb-scripts/config/externals.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ const camelCaseDash = string => string.replace( /-([a-z])/g, ( match, letter ) =
1919
*/
2020
const externals = [
2121
'components',
22+
'api-fetch',
2223
'edit-post',
2324
'element',
2425
'plugins',

0 commit comments

Comments
 (0)