Skip to content

Commit

Permalink
fix console error
Browse files Browse the repository at this point in the history
removes console warning:
```
esm.js:829 Performance warning! LoadScript has been reloaded unintentionally! You should not pass `libraries` prop as new array. Please keep an array of libraries as static class property for Components and PureComponents, or just a const variable outside of component, or somewhere in config files or ENV variables
```
  • Loading branch information
kfarr committed Sep 9, 2024
1 parent 3a49a92 commit 150e64e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/editor/components/Main.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ THREE.ImageUtils.crossOrigin = '';
const isStreetLoaded = window.location.hash.length;
const isPaymentModalOpened = window.location.hash.includes('/modal/payment');

// Define the libraries array as a constant outside of the component
const GOOGLE_MAPS_LIBRARIES = ['places'];

export default class Main extends Component {
constructor(props) {
super(props);
Expand Down Expand Up @@ -297,7 +300,7 @@ export default class Main extends Component {
/>
<LoadScript
googleMapsApiKey={firebaseConfig.apiKey}
libraries={['places']}
libraries={GOOGLE_MAPS_LIBRARIES}
>
<GeoModal
isOpen={this.state.isGeoModalOpened}
Expand Down

0 comments on commit 150e64e

Please sign in to comment.