这是我第一次尝试运行react-native项目.遵循反应原生方面提到的所有说明.并运行'npm start'在命令提示符下面出现以下错误:
ERROR watchman--no-pretty get-sockname returned with exit code null dyld: Library not loaded: /usr/local/lib/libpcre.1.dylib
Referenced from: /usr/local/bin/watchman
Reason: image not found
Error: watchman--no-pretty get-sockname returned with exit code null dyld: Library not loaded: /usr/local/lib/libpcre.1.dylib
Referenced from: /usr/local/bin/watchman
Reason: image not found
at ChildProcess.<anonymous> (/Users/z013mrq/AwesomeProject/node_modules/react-native/node_modules/sane/node_modules/fb-watchman/index.js:198:18)
at emitTwo (events.js:87:13)
at ChildProcess.emit (events.js:172:7)
at maybeClose (internal/child_process.js:818:16)
at Socket.<anonymous> (internal/child_process.js:319:11)
at emitOne (events.js:77:13)
at Socket.emit (events.js:169:7)
at Pipe._onclose (net.js:469:12)
Run Code Online (Sandbox Code Playgroud) 我有一个骨干应用程序,我试图集成React组件.
使用以下代码安装React组件:
ReactDOM.render(
<WrappedComponent />, node
);
其中node是DOM模式.这样React生命周期事件就像componentWillMount和componentDidMount一样被称为罚款.
但是当通过Backbone路由进行路由并且从DOM中删除React组件时,不会调用componentWillUnmount.
有解决方案吗
当我运行grunt babel任务时,它不断给我
笔记 :
运行 "babel:dist" (babel) 任务 [BABEL] 注意:代码生成器对 "common.js" 的样式进行了优化,因为它超过了 "100KB" 的最大值。[BABEL] 注意:代码生成器对“detailjs”的样式进行了去优化,因为它超过了“100KB”的最大值。
有人可以告诉我为什么会发生这种情况以及解决此问题的方法是什么?
我正在使用grunt-babel将ES6转换为ES5.我的文件名之一是app.collection.js,在运行任务后,将其重命名为app.js.
什么是解决此问题的babel选项.
/****************************************************************************
* Grunt Babel Compile ES6 to ES5
****************************************************************************/
babel: {
options: {
blacklist: ['strict'],
comments: true,
loose: ["es6.classes", "es6.properties.computed"],
"ignore": [
]
},
dist: {
files: [{ // Dictionary of files
expand: true,
cwd: '<%= config.path.app.js %>',
src: ['**/**/*.js'],
dest: '<%= config.path.app.js %>',
ext: '.js'
}]
}
}Run Code Online (Sandbox Code Playgroud)
我有一个外部Select反应组件,反过来渲染li标签.我想要li除了第一个margin-left20px 以外的所有样式;
以下是代码:
const StyledSelect = styled(Select)`
li {
margin-left: 20px;
}
`
Run Code Online (Sandbox Code Playgroud)
知道为什么这不起作用或其他方式吗?