React-native Android error SyntaxError: Strict mode does not allow function declarations in a lexically nested statement.

React-native Android error SyntaxError: Strict mode does not allow function declarations in a lexically nested statement.
Paste_Image.png

The solution,
, is an official issue. Don’t doubt yourself

Open node_modules / react-native / Libraries / Core / InitializeCore.js 112nd
, line function handleError (E, isFatal) change to var handleError = function (E, isFatal)

A lot of small partners can’t find this directory. That’s because the version is different

Node_modules / react-native / Libraries / JavaScriptAppEngine / Initialization / InitializeJavaScriptAppEngine.js

Line to 120

Finally, write a command line

NPM start ----reset-cache

In fact, you can do the same

React-native Android error SyntaxError: Strict mode does not allow function declarations in a lexically nested statement.
Paste_Image.png

Open the debug debug mode

Then you can run the project