我现在正在从事React和Redux项目。我想要实现的是从输入区域读取文件,并将状态另存为文件,然后使用动作和传奇通过HTTP请求传递它。
state={
file: {}
};
<Input
type="file"
accept="image/*"
onChange={(e) => {
let file = e.target.files[0];
console.log(file);
this.setState({file: file})}});
}}
>
</Input>
但这不起作用。有想法吗?
It gave error of this when I tried to see it in the React inspect.
backend.js:7715 Uncaught TypeError: Illegal invocation
at backend.js:7715
at Array.forEach (<anonymous>)
at Bridge._inspectResponse (backend.js:7711)
at Bridge._handleMessage (backend.js:7592)
at listener (backend.js:92)