in 3.2, material-ui cant dependence react-jss
@sunshixiong789 npm install react-jss
and you will be good. See #12993.
think you
I think it should be like before
react-jss
was always a transitive dependency. You should not import transitive dependencies. Eslint even has a rule implicit-dependency
against that.
@sunshixiong789 I'm considering the option of having a WithStylesProvider
.
@oliviertassinari for now doing npm install react-jss
solves the problem but in this way we need to install all the dependency's dependency at root of our package.json :(
@devamir What version are you using?
@oliviertassinari I was facing the issue Object(...) is not a function
on upgrading the material-ui
to 4.x.x
and then faced this issue/. It seemed to be the issue that npm install
was not installing all the sub-dependencies.
react-jss is not a dependency of v4.0.0. We might introduce it back in #16180.
I think I solved this issue by installing react-jss ^8.0.0
. I got that idea after I found this PR: https://github.com/mui-org/material-ui/pull/14237
If You already npm install react-jss
, You will probably get v10
of the package. To correct it, just do the following:
package.json
"react-jss"
dependency and set it to ^8.0.0
instead of ^10.0.0
react-jss
entry from package.LOCK.json
(from the .lock
file!!)npm install
and hope for the best :)@AleksandarSavic95
Material-UI depends on JSS v10. JSS v10 is not backward compatible with v9. Make sure JSS v9 is not installed in your environment. (Removing react-jss from your package.json can help). The StylesProvider component replaces the JssProvider one.
Most helpful comment
I think I solved this issue by installing react-jss
^8.0.0
. I got that idea after I found this PR: https://github.com/mui-org/material-ui/pull/14237If You already
npm install react-jss
, You will probably getv10
of the package. To correct it, just do the following:package.json
"react-jss"
dependency and set it to^8.0.0
instead of^10.0.0
react-jss
entry frompackage.LOCK.json
(from the.lock
file!!)npm install
and hope for the best :)