All Collections
Quick Start Guides
Add the store locator to a React component
Add the store locator to a React component

Let's see how we install our store locator widget inside a React component.

Updated over a week ago

In order to use the store locator with your React application, you need to use the Option 3 in the Install the Store Locator Widget page with few tweaks.

Add this to head scripts of your HTML:

<script src="//"></script> 

Then in your React component HTML, create a div to use for the store locator:

<div class="store-locator-widget"></div> 

Lastly, we need to initialize the store locator after your component has rendered. The best way to do so is in the componentDidMount() method of your component:

let config = {
    selector: ".store-locator-widget",
    account: "<YOUR_ACCOUNT_ID>"


Everything should work now! 😊

If you need help, send us a message and we'll help you specifically for your case.

Did this answer your question?