Skip to content

Commit

Permalink
fix(runtime): inject __DEV__ = false when evaluating code only
Browse files Browse the repository at this point in the history
  • Loading branch information
byCedric committed Oct 30, 2024
1 parent 594b5f6 commit 29d4036
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions runtime/src/Modules.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,10 @@ GestureHandler; // eslint-disable-line no-unused-expressions,@typescript-eslint/
// Unfortunately, this is handled by the bundler such as Metro or Webpack.
// That's not available inside the Snack Runtime itself.
// see: https://twitter.com/jamonholmgren/status/1561798978269618177
// @ts-expect-error
global['__DEV__'] = false;
if (!('__DEV__' in global)) {
// @ts-expect-error
global['__DEV__'] = false;
}

// Maintain project-level dependency state in the `ExpoDependencyV2` format.
// See https://github.com/expo/universe/blob/64a2eab474d11614c5b403f09747fdb112769a39/libraries/snack-sdk/src/types.js#L114-L126.
Expand Down

0 comments on commit 29d4036

Please sign in to comment.