title: React / Sentry for Error Reporting - How to not send errors from dev / localhost
body: <p>We're using Sentry in our React project by adding the following to our main <code>index.js</code> and <code>App.js</code> files:</p>
  <p><strong>index.js</strong></p>
  <pre><code>// Import Stuff
  import * as Sentry from '@sentry/react';
  import { Integrations } from '@sentry/tracing';
  ... import other important react stuff...
  
  // https://sentry.io/onboarding/cbb-analytics/get-started/ (not my real dsn)
  Sentry.init({
      dsn: 'https://asdkfa930209jcdzkljaasdfasdf@o123456.ingest.sentry.io/3293942',
      integrations: [
          new Integrations.BrowserTracing()
      ],
      tracesSampleRate: 1.0
  });
  
  ReactDOM.render(
      &lt;BrowserRouter&gt;
          &lt;App /&gt;
      &lt;/BrowserRouter&gt;,
      document.getElementById('root'));
  
  </code></pre>
  <p><strong>App.js</strong></p>
  <pre><code>import * as Sentry from '@sentry/react';
  ... other imports for app.js ...
  
  // And Create The App
  function App() {
      // check logged in...
      // check global state...
      // fetch some global data...
  
      return (
          &lt;GlobalContext.Provider value={globalStateObj}&gt;
              &lt;AppNavbar /&gt;
              &lt;LoginModal /&gt;
              &lt;Sentry.ErrorBoundary fallback={ErrorBoundaryFallback}&gt;
                  &lt;Switch&gt;
                      &lt;Route exact path='/' render={(props) =&gt; &lt;HomePage {...props} /&gt;}
                      &lt;Route exact path='/about-us' component={AboutUs} /&gt;
                      &lt;Route exact path='/reports' component={Reports} /&gt;
                      &lt;Route component={NoMatch} /&gt;
                  &lt;/Switch&gt;
              &lt;/Sentry.ErrorBoundary&gt;
  
              &lt;AppFooter /&gt;
          &lt;/GlobalContext.Provider&gt;
      );
  }
  
  export default App;
  </code></pre>
  <p>We could certainly be more granular with our Error Boundaries, but as it stands, wrapping the whole <code>switch</code>, which contains 99% of the code in our app, is getting the job done for us. Whenever a user runs into any issue on the website, we're getting that as an issue in Sentry.</p>
  <p>However, we would prefer it if Issues weren't created in Sentry if the error comes from dev / localhost... We break stuff / get errors all the time in dev when writing new code, and sending these as issues to Sentry just clutters Sentry and makes it a bit harder to keep track of those important errors that happen in production.</p>
  <p>Can we use our <code>process.env.NODE_ENV</code> to determine dev vs prod, and use this somewhere in <code>index.js</code> or in <code>App.js</code> to prevent issues from being sent for localhost? Or perhaps sentry has a way to explicitly ignore issues from an ip, like <code>localhost:3000</code>?</p>