rn:strict mode does not allow function declarations in a lexically nested statement
2017-02-20 16:28
507 查看
/node_modules/react-native/Libraries/Utilities/UIManager.js
because babel now adds 'use strict' automatically so it checks function declarations in a lexically nested statement
修改成如下代码:
/**
* Copies the ViewManager constants and commands into UIManager. This is
* only needed for iOS, which puts the constants in the ViewManager
* namespace instead of UIManager, unlike Android.
*/
if (Platform.OS === 'ios') {
// Copied from NativeModules
var normalizePrefix = function(moduleName){
return moduleName.replace(/^(RCT|RK)/, '');
}
// function normalizePrefix(moduleName) {
//
// }
}
because babel now adds 'use strict' automatically so it checks function declarations in a lexically nested statement
修改成如下代码:
/**
* Copies the ViewManager constants and commands into UIManager. This is
* only needed for iOS, which puts the constants in the ViewManager
* namespace instead of UIManager, unlike Android.
*/
if (Platform.OS === 'ios') {
// Copied from NativeModules
var normalizePrefix = function(moduleName){
return moduleName.replace(/^(RCT|RK)/, '');
}
// function normalizePrefix(moduleName) {
//
// }
}
相关文章推荐
- SyntaxError:Strict mode does not allow function declaration in a lexically nested statement.
- SyntaxError:Strict mode does not allow function declaration in a lexically nested statement.
- SyntaxError:Strict mode does not allow function declaration in a lexically nested statement.
- SyntaxError:Strict mode does not allow function declaration in a lexically nested statement.
- SyntaxError:Strict mode does not allow function declaration in a lexically nested statement.
- SyntaxError:Strict mode does not allow function declaration in a lexically nested statement.
- React-native运行异常之一一SyntaxError:Strict mode does not allow function declaration in a lexically nested
- SyntaxError:Strict mode does not allow function declaration in a lexically nested
- React-Native Strict mode does not allow ...
- vue报错:SyntaxError: Unexpected keyword 'const'. Const declarations are not supported in strict mode
- odi 1.7--statement is not in batch mode问题解决
- mysql创建触发器错误提示:Can not update in stored function/trigger already used by statement invoked
- Jira的 Transaction level 'READ-COMMITTED' in InnoDB is not safe for binlog mode 'STATEMENT'错误的解决
- IIS7.0 An ASP.NET setting has been detected that does not apply in Integrated managed pipeline mode
- The service cannot be activated because it does not support ASP.NET compatibility. ASP.NET compatibility is enabled for this application. Turn off ASP.NET compatibility mode in the web.config or add the AspNetCompatibilityRequirements attribute to the ser
- Jira的 Transaction level 'READ-COMMITTED' in InnoDB is not safe for binlog mode 'STATEMENT'错误的解决 原创 2
- An ASP.NET setting has been detected that does not apply in Integrated managed pipeline mode.
- 错误码: 1630 FUNCTION count does not exist. Check the 'Function Name Parsing and Resolution' section in
- iOS 5 does not allow to store downloaded data in Documents directory? ios5.0及以后的版本对于下载的文件存储路径有了改变
- FUNCTION line.count does not exist. Check the 'Function Name Parsing and Resolution' section in the