Skip to content

__DEV__ support #1580

@littlehome-eugene

Description

@littlehome-eugene

The problem
If you want to share code between RN and RN-web, __DEV__ should also be provided in the both platform.

However I can't add DEV using const __DEV__ = process.env.NODE_ENV !== 'production'; new webpack.DefinePlugin({__DEV__})

I can set window.__DEV__ fine, but RN code uses __DEV__

I've also tried adding module:metro-react-native-babel-preset

Expected behavior

Environment (include versions). Did this work in previous versions?

  • React Native for Web (version): 0.12.2
  • React (version): 16.12.0
  • Browser: chrome

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions