From 6bcc351fa2e36b9e0cd24428c29322999131cdfc Mon Sep 17 00:00:00 2001 From: apanizo Date: Mon, 3 Sep 2018 15:56:19 +0200 Subject: [PATCH] Creating a log boundaries utility for wrapping react errors --- src/utils/logBoundaries.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 src/utils/logBoundaries.js diff --git a/src/utils/logBoundaries.js b/src/utils/logBoundaries.js new file mode 100644 index 00000000..9db3a6a6 --- /dev/null +++ b/src/utils/logBoundaries.js @@ -0,0 +1,12 @@ +// @flow +export type Info = { + componentStack: string, +} + +export const logComponentStack = (error: Error, info: Info) => { + // eslint-disable-next-line + console.log(error) + // eslint-disable-next-line + console.log(info.componentStack) +} +