I'm using the latest stable version of Material UI in my production React app.
I need the updated Data Tables component, which is currently in Material UI's unstable alpha branch.
I don't want to upgrade my whole app with npm i material-ui@next
because of the numerous breaking changes.
How can I access the alpha library without upgrading my whole library? Can I install two versions of MUI? Can I call on the alpha API without installing it through NPM?
Thanks in advance.
I created in
/packages
a folder calledmaterial-ui-next
with only apackage.json
inside it which contains :So now from the root of the project one can do
npm install packages/material-ui-next --save
then one cancreatePalette = require('material-ui-next/styles/palette')
or whatever one wants to require frommaterial-ui
now aliased asmaterial-ui-next
.Explanations : as
"material-ui": "next"
is a dependency it's will be installed innode_modules/material-ui
so by adding a script after the packagematerial-ui-next
is installed to movenode_modules/material-ui
to the root of the package we canrequire('material-ui-next/WHATEVER')
After some googling, found this. To use both versions:
Then you can use
or