title: Connecting Redux Stores using Redux Toolkit
body: <p>for various reasons, my workplace is currently trying to introduce React/Redux into our project.  Our project utilizes Shopify and it's Liquid templates along with jQuery.  They want to migrate towards React, and we have thus far been injecting React by looking for specific ID's and injecting React Components in that way.</p>
  <p>Due to this, and because we are now needing a store to keep and render data, I've come to a strange issue.  If I wrap each one of these injected components with a Provider and store, I can essentially have each component with it's own store, but that doesn't help at all as it's pretty much mimicking local state.</p>
  <p>Is there a way for me to 'connect' and share the store with multiple components?</p>
  <p>I thought about wrapping the whole project, as is usually the case, but doing so would/should render the Liquid useless.</p>
  <p>Here's an example of what's going on:</p>
  <pre><code>import ReactDOM from &quot;react-dom&quot;;
  import React from &quot;react&quot;;
  
  import attrToProps from &quot;../../../partials/data-attribute-to-props.js&quot;;
  import FavoritesToggler from &quot;./index.js&quot;;
  import store from &quot;./../../Store/store&quot;
  import { Provider } from &quot;react-redux&quot;
  
  const rootEl = document.getElementById(&quot;fav-container-react&quot;);
  
  if(rootEl) {
      const props = attrToProps(rootEl.attributes);
      rootEl &amp;&amp; ReactDOM.render(&lt;Provider store={store}&gt;&lt;FavoritesToggler {...props} /&gt;&lt;/Provider&gt;, rootEl);
  }
  </code></pre>
  <p>This is injected into a div that contains the 'fav-container-react' id.</p>
  <p>But we have several of these at the moment, and I'm wondering how to get them to connect all to the same store.</p>
  <p>Any ideas would be appreciated, including perhaps a possible change in architecture (we're required to 'show progress' in order to continue getting funded, so starting a new project isn't an option.  Meaning I need a solution that is able to continuously update legacy code to React)</p>