StephenChou1017 / react-big-scheduler

A scheduler and resource planning component built for React and made for modern browsers (IE10+)
https://stephenchou1017.github.io/scheduler/#/
MIT License
754 stars 414 forks source link

Examples - Support for react-dnd 9.4.0 #163

Open chaitan94 opened 5 years ago

chaitan94 commented 5 years ago

As you may know react-dnd recently dropped the DragDropContext component [1], and introduced DndProvider [2]. This pull request makes the necessary changes to accommodate for that. This should also hopefully address some open issues like https://github.com/StephenChou1017/react-big-scheduler/issues/146 and https://github.com/StephenChou1017/react-big-scheduler/issues/147.

[1] https://github.com/react-dnd/react-dnd/pull/1439 [2] https://react-dnd.github.io/react-dnd/docs/api/dnd-provider

andrisundae commented 5 years ago

I just installed your library and use DragDrop.js example...But i still have issue like this...i also try change this withDnDcontext.js image

chaitan94 commented 5 years ago

@andrisundae can you give more details? Do you mean to say you are facing this issue even after working on top of my commit? Could you share the exact version of react-dnd which is being used in your project?

andrisundae commented 5 years ago

@chaitan94 Thank u, i just installed React CRA and add react-dnd@9.4.0, react-big-scheduler new version for depedencies...And use withDnDContext.js from your last commit... But i still facing this issue... If i clone this library and running for locally i'am not facing this issue again... Please help me..thank u..

tannerhallman commented 4 years ago

I also can confirm I was getting the same issue as @andrisundae. I used the Basic.js example from this repo to try it. For reference, I was working with react-big-scheduler@0.2.7 and then I downgraded to react-big-scheduler@0.2.6 and it worked with your changes listed below:

withDnDContext.js

/* eslint-disable react/display-name */
// import { DragDropContext } from 'react-dnd'
// import HTML5Backend from 'react-dnd-html5-backend'

// export default DragDropContext(HTML5Backend)

import * as React from 'react'
import { DndProvider } from 'react-dnd'
import HTML5Backend from 'react-dnd-html5-backend'

export default Component => {
  return props => (
    <DndProvider backend={HTML5Backend}>
      <Component {...props} />
    </DndProvider>
  )
}

package.json

    "react-dnd": "^9.4.0",
    "react-dnd-html5-backend": "^9.4.0",
    "react-big-scheduler": "^0.2.6",
alizaidi606 commented 4 years ago

@chaitan94 have you published your version of this library to npm?

chaitan94 commented 4 years ago

@chaitan94 have you published your version of this library to npm?

No, I haven't.

alizaidi606 commented 4 years ago

@chaitan94 I am trying to publish this to npm by cloning from your repo the one with the pull request but am having issues while building package. That issue is also mentioned on this latest issue #201

\react-big-scheduler\react-big-scheduler\scripts\build.js:11 throw err; ^ TypeError [ERR_INVALID_ARG_TYPE]: The "chunk" argument must be of type string or an instance of Buffer. Received an instance of Error at validChunk (_stream_writable.js:279:10) at WriteStream.Writable.write (_stream_writable.js:314:21) at build (\react-big-scheduler\react-big-scheduler\scripts\build.js:70:20) at processTicksAndRejections (internal/process/task_queues.js:97:5) Emitted 'error' event on WriteStream instance at: at errorOrDestroy (internal/streams/destroy.js:108:12) at validChunk (_stream_writable.js:282:5) at WriteStream.Writable.write (_stream_writable.js:314:21) at build (\react-big-scheduler\react-big-scheduler\scripts\build.js:70:20) at processTicksAndRejections (internal/process/task_queues.js:97:5) { code: 'ERR_INVALID_ARG_TYPE' } npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! react-big-scheduler@0.2.9 build: `node scripts/build.js` npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the react-big-scheduler@0.2.9 build script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above. npm ERR! A complete log of this run can be found in:
massile commented 3 years ago

Is there any updates regarding this issue? I still have the same issue with the newer version of react-big-scheduler (0.2.7)

beysong commented 2 years ago

I have update antd to 4.x and react-dnd to 14.x, but in my forked respository https://github.com/StephenChou1017/react-big-scheduler