Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: Expected reorderId to be a string. Instead got undefined #91

Closed
francoishuyghe opened this issue Oct 31, 2017 · 12 comments
Closed

Comments

@francoishuyghe
Copy link

I'm running into this issue and didn't find any information about it in the documentation.

I tried a lot of different configurations with the same result. When I add reorderId='_id' to my list of props, I lose the warning and a div is created, but nothing is inside.

Reorder is added to my component this way: import Reorder from 'react-reorder'

And in the render:

<Reorder 
    itemKey='_id'
    lock='horizontal'
    holdTime={0}
    list={this.props.user.mylist}
    template={Listing}
    listClass='my-list'
    itemClass='list-item'
    callback={this.callback}
    listClass='my-list'
    itemClass='list-item'
    itemClicked={this.itemClicked}
    selected={this.state.selected}
    selectedKey='_id'
    disableReorder={false}
/>
@CadiChris
Copy link

I'm hitting the same issue.
The only place where I've found reorderId is on the rework branch : https://github.com/JakeSidSmith/react-reorder/tree/rework

Current released version of the npm package is 3.0.0-alpha.2 so it's clearly OK for it to be unstable.
My guess is that the npm release is linked to rework branch, but that we'd better install stable release.
I'll try to install the latest stable release, and update this thread if this works.

@JakeSidSmith
Copy link
Owner

The config / markup has changed a lot for v3. Are you following the new readme?

https://github.com/JakeSidSmith/react-reorder/tree/rework#configuration

@CadiChris
Copy link

Oh right, that makes sense.
I was using master branch README against v3 package. And think @13ms was doing the same.

I just yarn add react-reorder@2.2.1 and reorderId error is gone.

@JakeSidSmith : For production software, is it better to use v3 alpha, or 2.2.1 is currently more reliable ?

@JakeSidSmith
Copy link
Owner

Uhhh. Hard to say. Personally I'd go with v3, as if you are not using multiple lists (in v3 you can drag between lists) v3 has some bug fixes that are not in v2. Though there is a bug with the dragging between lists #78 (comment).

@CadiChris
Copy link

OK, I'll give a shot at v3, thanks !
Are you interested in a PR on master's README pointing out that users of v3 should read the rework README? This could avoid potential frustration for future users :D

@JakeSidSmith
Copy link
Owner

Just sorted that: https://github.com/JakeSidSmith/react-reorder/blob/master/README.md

Great minds. 😛

@JakeSidSmith
Copy link
Owner

Note: if using a component class / stateless component you will need to manually pass down the reorder props: #78 (comment)

Will hopefully find a way to avoid this in the future. 😄

@JakeSidSmith
Copy link
Owner

Ignore what I said about the multi-list bug, forgot I had merged this: #83

@CadiChris
Copy link

Just to confirm that v3 is working perfectly ! IMO this issue deserves to be Closed 🙂

@JakeSidSmith
Copy link
Owner

Will do. 😀

@jorisw
Copy link

jorisw commented Dec 12, 2017

Except that npm install react-reorder installs v3, while GitHub shows the v2 docs.

@JakeSidSmith
Copy link
Owner

NPM install always installs the latest version, which in this case is the alpha version. I may merge v3 as is to avoid confusion and continue work on it.

https://medium.com/@mbostock/prereleases-and-npm-e778fc5e2420

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants