fix: handle invalid Algolia keys gracefully in dev (#37088)
Invalid keys throw an error in production, but just cause invalid PropTypes and build warnings in development.
This commit is contained in:
committed by
mrugesh
parent
4889e0fdc6
commit
e72855dad3
@@ -20,7 +20,11 @@ import { createSelector } from 'reselect';
|
||||
|
||||
const DEBOUNCE_TIME = 100;
|
||||
|
||||
const searchClient = algoliasearch(algoliaAppId, algoliaAPIKey);
|
||||
// If a key is missing, searches will fail, but the client will still render.
|
||||
const searchClient =
|
||||
algoliaAppId && algoliaAPIKey
|
||||
? algoliasearch(algoliaAppId, algoliaAPIKey)
|
||||
: {};
|
||||
|
||||
const propTypes = {
|
||||
children: PropTypes.any,
|
||||
|
Reference in New Issue
Block a user