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
760 stars 414 forks source link

react 17.x support #238

Open wassimmohamed opened 2 years ago

wassimmohamed commented 2 years ago

When i use this library with latest react version (17.x) with hooks it is not rerendering. ex, setSchedulerData(schedulerData) is not working while changing the view. But when i use class component it is working fine. ex, this.setState({schedulerData:_schedulerData}) Is there any workaround/ fix?

tdangkhoa0303 commented 2 years ago

This workaround worked for me. You can give it a try


const nextSchedulerData = Object.assign(
        Object.create(Object.getPrototypeOf(schedulerData)),
        schedulerData
);
setSchedulerData(nextSchedulerData);
themetzmeier commented 2 years ago

@tdangkhoa0303 could you post a barebones demo code of the scheduler working in hooks, I have tried repeatedly to get a version of this working with hooks and have been unable.

Sahinugur commented 2 years ago

When I use this library with 17.x version of react gives me error so:

react-dom.development.js:67 Warning: componentWillReceiveProps has been renamed, and is not recommended for use. See https://reactjs.org/link/unsafe-component-lifecycles for details.

Please update the following components: EventItem, ResourceEvents

when I click screen everything disappear and this time errors appear. If someone help me about this I would be so glad.

hbatalhaStch commented 1 year ago

When I use this library with 17.x version of react gives me error so:

react-dom.development.js:67 Warning: componentWillReceiveProps has been renamed, and is not recommended for use. See https://reactjs.org/link/unsafe-component-lifecycles for details.

  • Move data fetching code or side effects to componentDidUpdate.
  • If you're updating state whenever props change, refactor your code to use memoization techniques or move it to static getDerivedStateFromProps. Learn more at: https://reactjs.org/link/derived-state
  • Rename componentWillReceiveProps to UNSAFEcomponentWillReceiveProps to suppress this warning in non-strict mode. In React 18.x, only the UNSAFE name will work. To rename all deprecated lifecycles to their new names, you can run npx react-codemod rename-unsafe-lifecycles in your project source folder.

Please update the following components: EventItem, ResourceEvents

when I click screen everything disappear and this time errors appear. If someone help me about this I would be so glad.

Don't know if you are still using this package but I forked the repo and made some changes.