Skip to content

Latest commit

 

History

History
53 lines (36 loc) · 1.44 KB

File metadata and controls

53 lines (36 loc) · 1.44 KB
id title officialDoc
logbox
LogBox

Errors and warnings in development builds are displayed in LogBox inside your app.

LogBox is automatically disabled in release (production) builds.

ignoreLogs

Console errors and warnings are displayed as on-screen notifications with a red or yellow badge, and the number of errors or warning in the console respectively. To view a console error or warnings, tap the notification to view the full screen information about the log and to paginiate through all of the logs in the console.

type signature

ignoreLogs: array(string) => unit

example

open ReactNative

LogBox.ignoreLogs([
  "Require cycle:",
  "Remote debugger",
  "Accessing view manager configs",
  "Warning: componentWillReceiveProps",
  "Warning: componentWillMount",
])

ignoreAllLogs

These notifications can be hidden using ReactNative.LogBox.ignoreAllLogs(). This is useful when giving product demos, for example. Additionally, notifications can be hidden on a per-log basis via ReactNative.LogBox.ignoreLogs([|"Require cycle:"|]). This is useful when there's a noisy warning that cannot be fixed, like those in a third-party dependency.

Ignore logs as a last resort and create a task to fix any logs that are ignored.

type signature

ignoreAllLogs: unit => unit

example

open ReactNative

LogBox.ignoreAllLogs()