rouftom / react-mui-scheduler

React material planner is a react component based on @mui v5 that allows you to manage data in a calendar
https://rouftom.github.io/react-mui-scheduler-demo/
MIT License
64 stars 29 forks source link

Demo code not working? #4

Closed manuargue closed 2 years ago

manuargue commented 2 years ago

Hello. I created an empty project, install react-mui-scheduler, and copy-paste the example in the readme to give it a try, but it fails to run the app with error: image

There seems to be some problems with the dependencies:

> mkdir test
> cd test
> npm init
> npm install --save react-mui-scheduler
npm WARN ERESOLVE overriding peer dependency
npm WARN While resolving: @mui/x-date-pickers@5.0.0-alpha.0
npm WARN Found: react@18.1.0
npm WARN node_modules/react
npm WARN   peer react@">=16.8.0" from @emotion/react@11.9.0
npm WARN   node_modules/@emotion/react
npm WARN     @emotion/react@"^11.8.2" from react-mui-scheduler@2.0.0
npm WARN     node_modules/react-mui-scheduler
npm WARN     4 more (@emotion/styled, @mui/material, @mui/system, @mui/styled-engine)
npm WARN   13 more (@emotion/styled, @mui/icons-material, @mui/material, ...)
npm WARN 
npm WARN Could not resolve dependency:
npm WARN peer react@"^17.0.2" from @mui/x-date-pickers@5.0.0-alpha.0
npm WARN node_modules/@mui/x-date-pickers
npm WARN   @mui/x-date-pickers@"5.0.0-alpha.0" from @mui/lab@5.0.0-alpha.79
npm WARN   node_modules/@mui/lab
npm WARN 
npm WARN Conflicting peer dependency: react@17.0.2
npm WARN node_modules/react
npm WARN   peer react@"^17.0.2" from @mui/x-date-pickers@5.0.0-alpha.0
npm WARN   node_modules/@mui/x-date-pickers
npm WARN     @mui/x-date-pickers@"5.0.0-alpha.0" from @mui/lab@5.0.0-alpha.79
npm WARN     node_modules/@mui/lab

Could you please help me to take a look? The component seems great btw! Thanks

rouftom commented 2 years ago

Hello @manuargue,

The library was developed upstream of React, did you install react in your project before installing react-mui-scheduler ?

manuargue commented 2 years ago

Yes, sorry I forgot to mention that. I've also tried creating an app from scratch with npx create-react-app ./test and then npm i --save react-mui-scheduler inside ./test. The warnings during npm install and errors during app launch are the same as reported above. My package.json after creating the barebones react app contains:

  "dependencies": {
    "@testing-library/jest-dom": "^5.16.4",
    "@testing-library/react": "^13.1.1",
    "@testing-library/user-event": "^13.5.0",
    "react": "^18.1.0",
    "react-dom": "^18.1.0",
    "react-scripts": "5.0.1",
    "web-vitals": "^2.1.4"
  },

Perhaps would be useful to have a codepen or similar with the sample code. Would it be too much trouble to create one?

rouftom commented 2 years ago

Here is a demo: https://codesandbox.io/s/relaxed-neumann-174pod?file=/src/App.js

Do not hesitate to reopen the issue if you have a problem.

jameskirkpatrick23 commented 1 year ago

So to be sure I understand this. I need to uninstall react, and uninstall this package. Then reinstall this package. Then reinstall react?