React-dropzone: TypeError: getRootProps is not a function

Created on 14 Dec 2018  路  4Comments  路  Source: react-dropzone/react-dropzone

Is it still required to wrap the internals of Dropzone with getRootProps? I'm on 7.0.1

screen shot 2018-12-14 at 8 59 31 am

My code:

import React, { Component } from 'react';
import Dropzone from 'react-dropzone';


class DropzoneTest extends Component {

  onDrop(files) {
      // do something
  }

  render() {
    return (
        <Dropzone onDrop={this.onDrop.bind(this)}>
          {({getRootProps, getInputProps}) => (
              <div {...getRootProps()}>
                <input {...getInputProps()} />
                <p>Drop files here</p>
              </div>
          )}
        </Dropzone>
    );
  }
}

export default DropzoneTest;

Most helpful comment

@sitompul of course, use https://github.com/react-dropzone/react-dropzone/tree/v{x.y.z} where {x.y.z} is replaced with the version you're looking for, e.g.: https://github.com/react-dropzone/react-dropzone/tree/v6.2.3.

All 4 comments

@steverecio as you can see in releases, the breaking change was only introduced in 8.0.0, so you can continue using the lib as you did previously.

is there a way to access the old documentation? @rolandjitsu

@sitompul you can review the README at it's particular release to view the documentation.

@sitompul of course, use https://github.com/react-dropzone/react-dropzone/tree/v{x.y.z} where {x.y.z} is replaced with the version you're looking for, e.g.: https://github.com/react-dropzone/react-dropzone/tree/v6.2.3.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

xswordsx picture xswordsx  路  3Comments

artsx picture artsx  路  4Comments

xuefanzhang picture xuefanzhang  路  4Comments

Mangatt picture Mangatt  路  4Comments

ghost picture ghost  路  3Comments