Skip to content

Commit

Permalink
Fix: ENV was not loading from .env file
Browse files Browse the repository at this point in the history
  • Loading branch information
viral-sangani committed Jul 5, 2023
1 parent 29ace10 commit ab87ae8
Show file tree
Hide file tree
Showing 6 changed files with 613 additions and 21 deletions.
14 changes: 6 additions & 8 deletions packages/react-native-app-without-expo/App.tsx
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
// @ts-expect-error - `@env` is a virtualised module via Babel config.
import {ENV_PROJECT_ID} from '@env';

import React from 'react';
import {StatusBar, StyleSheet} from 'react-native';
import {SafeAreaProvider} from 'react-native-safe-area-context';
import {Web3Modal} from '@web3modal/react-native';
import {useEffect} from 'react';
import {LogBox} from 'react-native';
import {LogBox, StatusBar, StyleSheet} from 'react-native';
import {SafeAreaProvider} from 'react-native-safe-area-context';
import {providerMetadata, sessionParams} from './constants/Config';
import {ThemeProvider} from './context/ThemeProvider';
import useColorScheme from './hooks/useColorScheme';
import Navigation from './navigation';
import {ThemeProvider} from './context/ThemeProvider';
import {Web3Modal} from '@web3modal/react-native';
import {providerMetadata, sessionParams} from './constants/Config';

console.log(ENV_PROJECT_ID);
console.log('ENV_PROJECT_ID', ENV_PROJECT_ID);

const App = () => {
const colorScheme = useColorScheme();
Expand Down
14 changes: 1 addition & 13 deletions packages/react-native-app-without-expo/babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,7 @@ module.exports = function (api) {
return {
presets: ['module:metro-react-native-babel-preset'],
plugins: [
[
'module:react-native-dotenv',
{
envName: 'APP_ENV',
moduleName: '@env',
path: '.env',
blocklist: null,
allowlist: null,
safe: false,
allowUndefined: true,
verbose: false,
},
],
['module:react-native-dotenv'],
[
'@babel/plugin-transform-react-jsx',
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -596,6 +596,7 @@
"-DFOLLY_MOBILE=1",
"-DFOLLY_USE_LIBCPP=1",
);
REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native";
SDKROOT = iphoneos;
};
name = Debug;
Expand Down Expand Up @@ -659,6 +660,7 @@
"-DFOLLY_MOBILE=1",
"-DFOLLY_USE_LIBCPP=1",
);
REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native";
SDKROOT = iphoneos;
VALIDATE_PRODUCT = YES;
};
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit ab87ae8

Please sign in to comment.