wko27 / react-mathjax

MathJax as React component
MIT License
168 stars 71 forks source link

Made React a peer dependency. (Fixes Issue #11) #24

Open joshhales1 opened 3 years ago

joshhales1 commented 3 years ago

The second installation of React created by this package causes this error to be thrown and break the application:

Uncaught Invariant Violation: Element ref was specified as a string (node) but no owner was set. This could happen for one of the following reasons:
1. You may be adding a ref to a function component
2. You may be adding a ref to a component that was not created inside a component's render method
3. You have multiple copies of React loaded
See https://fb.me/react-refs-must-have-owner for more information.

This is discussed in #11 as is fixed in this PR.

Having React as a peer dependency fixes this issue. This follows the format of other React packages having React as a peer dependency.

This also massively reduces the installation time of the package.