Welcome to WuJiGu Developer Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
291 views
in Technique[技术] by (71.8m points)

reactjs - Typerror: n is not a function using react-dropzone

This is the error I'm getting right now

index.js:65 is in react-dropzone, the line is

return /*#__PURE__*/React.createElement(Fragment, null, children(_objectSpread(_objectSpread({}, props), {}, {
open: open

This is my current component functionality:

handleDrop = (files) => {
    console.log('Hello');
}


render() {


    const previewStyle = {
        display: 'inline',
        width: 100,
        height: 100,
    };

    return (

        <div>
            <Dropzone
                onDrop={this.handleDrop}
            >
            Drop it here
            </Dropzone>
        </div>
    );
}

This only happens when I try ot use the react-dropzone component. I decided to try it out, but I can't figure out why its throwing this error. When I remove the DropZone, it works fine, but when I try to put it in, it throws the error not matter what elements are inside.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to WuJiGu Developer Q&A Community for programmer and developer-Open, Learning and Share
...