title: How to monkey patch a React module from Clojurescript
body: <p>I'm using <code>react-select</code> in a ClojureScript project but there is an hardcoded string that I'd like to translate (see it <a href="https://github.com/JedWatson/react-select/blob/e0ccbb939b706dcd560ad34223ab57e20cf0dc49/src/Creatable.js#L218" rel="nofollow noreferrer">here</a>):</p>
  
  <pre><code>function promptTextCreator (label) {
      return `Create option "${label}"`;
  }
  </code></pre>
  
  <p>I'll send a PR to make this string configurable but in the meantime I have a question.</p>
  
  <p>If I inspect my app from the JS console, I can type:</p>
  
  <pre><code>&gt; window.deps["react-select"]["Creatable"].promptTextCreator
  </code></pre>
  
  <p>which prints</p>
  
  <pre><code>ƒ c(e){return'Create option "'+e+'"'}
  </code></pre>
  
  <p>Now in my cljs project I tried this:</p>
  
  <pre><code>(set! (.-promptTextCreator Creatable) #(str "TESTING " % "!"))
  </code></pre>
  
  <p>What is interesting is that I can see the change in the app since:</p>
  
  <pre><code>&gt; window.deps["react-select"]["Creatable"].promptTextCreator
  </code></pre>
  
  <p>now prints</p>
  
  <pre><code>ƒ (p1__44104_SHARP_){
      return [cljs.core.str("TESTING "),cljs.core.str(p1__44104_SHARP_),cljs.core.str("!")].join('');
  }
  </code></pre>
  
  <p>Problem: my app still displays the old unchanged string. I also tried to name the new function with:</p>
  
  <pre><code>(set! (.-promptTextCreator Creatable) (fn c [e] (str "TESTING " e "!")))
  </code></pre>
  
  <p>and</p>
  
  <pre><code>&gt; window.deps["react-select"]["Creatable"].promptTextCreator
  </code></pre>
  
  <p>now prints:</p>
  
  <pre><code>ƒ club$views$c(e){
      return [cljs.core.str("TESTING "),cljs.core.str(e),cljs.core.str("!")].join('');
  }
  </code></pre>
  
  <p>But no luck: the old untranslated string is displayed in the app.</p>
  
  <p>Any idea?</p>