我尝试使用 react-native start 运行 react-native-cli 项目,但是 Metro bundler 失败了,说如下:
events.js 187
throw er; //Unhandled 'error' event
Error: EMFILE: too many open files, watch
Emitted 'error' event on NodeWatcher isntance at:
at NodeWatcher: checkedEmitError (.../react-native-project/node_modules/sane/src/node_watcher.js:143:12)
at FSWatcher.emit (events.js:210:5)
at FSEvent.FSWatcher:_handle onchange (internal/fs/watchers.js:129:12) {
errno: -24,
syscall: 'watch',
code : 'EMFILE',
filename: null
)
Process terminated. Press <enter> to close the window
Run Code Online (Sandbox Code Playgroud) 关于 Amazon S3 的理论问题。
S3-IA Get 请求的定价存在差异:$.001 / 10K 和 S3 数据检索成本:$.01。
我的问题是,获取请求和数据检索之间有什么区别?
我正在尝试使用 Amplify 将图像从 React Native 上传到 S3。我能够成功上传文本文件。但不是图像。
这是我的代码:
import React from 'react';
import {View, Text, Button, Image} from 'react-native';
import {identityPoolId, region, bucket} from '../auth';
import image from '../assets/background.png';
import Amplify, {Storage} from 'aws-amplify';
Amplify.configure({
Auth: {identityPoolId,region},
Storage : {bucket,region}
})
const upload = () => {
Storage.put('logo.jpg', image, {contentType: 'image/jpeg'})
.then(result => console.log('result from successful upload: ', result))
.catch(err => console.log('error uploading to s3:', err));
}
const get = () => { //this works for both putting and getting …Run Code Online (Sandbox Code Playgroud) image amazon-s3 amazon-web-services react-native aws-amplify
我正在使用 android 模拟器在 Windows 10 上运行 expo 应用程序。隧道建立,模拟器启动。但世博会在模拟器上不断崩溃。
我尝试从模拟器中卸载 expo,然后重新启动机器。有任何想法吗?
为什么箭头函数优先于 JavaScript 类中的函数声明?
例子 :
class Parent {
work = () => {
console.log('This is work() on the Parent class');
}
}
class Child extends Parent {
work() {
console.log("This is work() on the Child class ");
}
}
const kid = new Child();
kid.work();
Run Code Online (Sandbox Code Playgroud)
在这个例子中,父 work() 方法被触发:
“这是父类上的 work()”
我只是想了解为什么箭头函数在 JS 类中总是优先,尤其是在继承和多态方面。
react-native ×3
amazon-s3 ×2
android ×1
aws-amplify ×1
class ×1
es6-class ×1
expo ×1
image ×1
inheritance ×1
javascript ×1
polymorphism ×1