React-native: Enable the new LogBox (RN)

Created on 17 Feb 2020  路  7Comments  路  Source: facebook/react-native

I'm trying to enable the new LogBox in React Native (v0.62.0-rc.2), I just have to add a line to the "index.js" file but it doesn't work.

RC2 introduces the new LogBox experience behind a feature flag. To try
it out, add the following to your index.js file:

require('react-native').unstable_enableLogBox()

index.js

require('react-native').unstable_enableLogBox();

import {AppRegistry} from 'react-native';
import App from './App';
import {name as appName} from './app.json';

AppRegistry.registerComponent(appName, () => App);

Error output:

TypeError: _$$_REQUIRE(_dependencyMap[1], "react-native").unstable_enableLogBox is not a function.

I'm sure I'm doing something wrong, maybe it's not the right way.

Environment Info Needs Ran Commands

Most helpful comment

how do you do this in typescript? my app does not have an index.js but an App.tsx

All 7 comments


Thanks for submitting your issue. Please run react-native info in your terminal and copy the results into your issue description after "React Native version:". If you have already done this, please disregard this message.

馃憠 Click here if you want to take another look at the Bug Report issue template.

I am closing this issue because it does not contain the necessary environment info, and there has been no followup in a while.

If you found this thread after encountering the same issue in the latest release, please feel free to create a new issue with up-to-date information by clicking here.

did you figure it out?

how do you do this in typescript? my app does not have an index.js but an App.tsx

Anybody got it to run on typescript?
import { LogBox } from 'react-native' not found in App.tsx

Anybody got it to run on typescript?
import { LogBox } from 'react-native' not found in App.tsx

Did you update your @types/react-native to version 0.63.18?

I think that problem same with me. My problem is using console.log but the variables doesn't print in terminal. Anyone can help me? Or this issues is my answer? Thanks before

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jlongster picture jlongster  路  3Comments

axelg12 picture axelg12  路  3Comments

grabbou picture grabbou  路  3Comments

madwed picture madwed  路  3Comments

lazywei picture lazywei  路  3Comments