FormidableLabs / react-music

Make beats with React!
http://reactmusic.surge.sh
MIT License
2.72k stars 196 forks source link

React 16 support #49

Closed karla-moreno closed 6 years ago

karla-moreno commented 6 years ago

Expected Behavior: When creating a test project to try out react-music and running it, I should be able to hear sound playing. Current Behavior: When installing/running the project, it fails and gives these errors. This in terminal when attempting to npm install react-music

WARN react-music@1.0.2 requires a peer of react-dom@^15.2.1 but none is installed. You must install peer dependencies yourself.

And this in browser when attempting to npm start

TypeError: Cannot read property 'propTypes' of undefined

Possible Solution: I read here that changes made to PropTypes have changed:

React.createClass is now available as create-react-class, React.PropTypes as prop-types, ...

It's likely that the changes in the switch from 15.x.x to 16.x.x are causing the error to occur and can possibly be fixed by having react-music package install proptypes to be compatible with the newest version of react.
Steps to Reproduce: Initiate a project using create-react-app <project-name> if the create-react-app module is installed. npm install react-music in the project, create a test to ensure react-music package is working and npm start Context: In trying to create this project, I ran into the PropTypes error many times and could not find an answer that wasn't too specific or even touched on the differences between react 15.x.x and 16.x.x. After talking with an instructor, we looked at differences in the package.json of the react project from the demo to a test project and saw that the demo was using react 15.2.1 and the create-react-app command installs the newest version of react on the test project. After uninstalling react from the test project and npm install react@15.2.1, the test project started working. Your Environment: Ubuntu 16.04, Chrome 60+, React 16/React 15.2.1

You'll find in my project using react-music a commit showing the differences, and that the subsequent commits indicate a success in making it work.

ryan-roemer commented 6 years ago

Yep, we'll need an update for react 16 with

PR welcome! Or, we'll eventually get around to it in our queue...