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
753 stars 415 forks source link

Does not seem to be compatible with latests versions of React #88

Open aenkirch opened 5 years ago

aenkirch commented 5 years ago

Hi ! Already told the dev by email, but the project (at least the Demo version) says it require to import react-dnd and react-dnd-html5-backend when trying to update React version in the package.json file ! But when you do so : the events won't appear anymore in the scheduler...

Sail338 commented 5 years ago

Also not working for me

bl5ck commented 5 years ago

Sorry but I doubt that. Because I tried with react@16.7.0 with the demo but it works. I doesn't have the same error message as yours (maybe because I installed react-dnd and react-dnd-html5-backend). But I feel it is more like Webpack configuration issue. Because I tried with the default Webpack configuration (comes along with react-script) and my own project Webpack configuration, and the first one works.

bl5ck commented 5 years ago

Quick debugging revealed that even if renderData has data, and being mapped to resourceEventsList successfully (mapped to React component object), the <tbody> inside .scheduler-content-table render empty content still. So I think there must be some compatibility issues between DnD drop target and React. React debug tool also shows empty content inside context.consumer of dndContext.

bl5ck commented 5 years ago

I also tried this solution but doesn't work. With the demo, I tried to put the DragDropContextProvider inside a non-root component and it still shows the events, while mine version, even when put at root component, still doesn't show the events.

GennadyPonomarev commented 5 years ago

I experience the same issue when react-dnd is installed explicitly. The latest react-dnd version is 7.0.2, this package uses 5.0.0. So it's probably api changes / compatibility issues.

It does work with the 5.0.0 release with DragDropContextProvider wrapper.

StephenChou1017 commented 5 years ago

I clone my latest repo locally in an empty folder, remove the package-lock.json, and update package.json:

    "react": "^16.7.0",
    "react-dnd": "^7.0.2",
    "react-dnd-html5-backend": "^7.0.2",
    "react-dom": "^16.7.0",

then npm install and npm run example, it works fine.

bl5ck commented 5 years ago

Then the problem should be in webpack.config.js

Lyca0n commented 5 years ago

Can we append the configurations that work, I'm having the same issue, using JHipster

"react-jhipster": "0.7.0", "react-big-scheduler": "^0.2.4", "react-dnd": "^7.0.2", "react-dnd-html5-backend": "^7.0.2", "react-dom": "16.4.2",

wldcordeiro commented 5 years ago

This seems to be broke on latest react for sure. I see the drag source not rendering out.

hraboviyvadim commented 5 years ago

Any updates about this? I have tried it with this: "react": "^16.8.3", "react-big-scheduler": "^0.2.6", "react-dnd": "^7.3.1", "react-dnd-html5-backend": "^7.2.0", "react-dom": "^16.8.3", and it doesn't show events

marchenko-ia12 commented 5 years ago

I try all lates modules in demo - all ok, but on my main project it doesn't show events and doesn't create new event.

FizzBuzz791 commented 5 years ago

OK, so I've been looking into this, it's hairy!

I cloned the demo; React Big Scheduler Demo. There's a few interesting things here, but the big one is that react-dnd and react-dnd-html5-backend aren't actually in the package.json.

npm install on the demo worked fine and the demo runs, just like the online demo.

Then I tried npm ls react-dnd and noticed that it's 5.0.0, when I looked at my actual repo, there's 2 installs of react-dnd: v5.0.0 as the RBS dependency and the latest version (7.something) due to my explicit requirement in my package.json. When I removed my explicit requirement and the node_modules directory and then did a clean npm install, I only ended up with 1 react-dnd at v5.0.0 and my repo worked!

Obviously, there's breaking changes. Makes sense considering it's a major version upgrade. I think this package is fine how it is, it's not surprising that it breaks when a new major of react-dnd is installed and this package correctly locks it to v5. That said, there's a new version of react-dnd for a reason, so it'd be nice if this package used it...