Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Install] I want to install MaterialUI by CDN #38751

Closed
twice7713 opened this issue Sep 1, 2023 · 6 comments
Closed

[Install] I want to install MaterialUI by CDN #38751

twice7713 opened this issue Sep 1, 2023 · 6 comments
Assignees
Labels
package: system Specific to @mui/system support: Stack Overflow Please ask the community on Stack Overflow

Comments

@twice7713
Copy link

twice7713 commented Sep 1, 2023

On old Version I used under code,Work Material UI Scuessed

<script src="//unpkg.com/@material-ui/core@latest/umd/material-ui.production.min.js"></script>

declare let MaterialUI: any
const {
Button,makeStyles,
} = MaterialUI

I want to Upgrade version by CDN

<script src="https://unpkg.com/@mui/material@latest/umd/material-ui.production.min.js"crossorigin="anonymous"</script>

I'm already import this.but Can't use makeStyles and Icon
Give me some import and used example Thank~

@github-actions github-actions bot added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Sep 1, 2023
@zannager zannager added the package: system Specific to @mui/system label Sep 1, 2023
@brijeshb42
Copy link
Contributor

makeStyles has been removed in v5 of material-ui. You'll need to use the last version of v4 to continue using that.

@twice7713
Copy link
Author

makeStyles已在 Material-ui v5 中刪除。您需要使用 v4 的最新版本才能繼續使用它。

thanks for your reply,
how would normally replace makeStyles?

@brijeshb42
Copy link
Contributor

brijeshb42 commented Sep 1, 2023

We do have makeStyles available in @mui/styles package. But it's UMD build is not available. So you can't directly use it from cdn.

@twice7713
Copy link
Author

Although you have completely answered my question, can you help me modify this code? Without using makeStyles.

`const fabStyles = makeStyles(theme => ({
fab: {
position: 'absolute',
top: theme.spacing(2),
left: theme.spacing(2),
zIndex: 1000,
},
}))

const FloatingBackButton = withRouter(({history}) => {
const classes = fabStyles()
return (
<Fab
className={classes.fab}
color='secondary'
onClick={() => history.push(path(location, '..'))}
>


)
})`

@brijeshb42
Copy link
Contributor

I might be able to help if you have a codesandbox with your code. Github issues is not a great place for code demos.

@brijeshb42 brijeshb42 assigned brijeshb42 and unassigned mnajdova Sep 1, 2023
@brijeshb42 brijeshb42 added status: waiting for author Issue with insufficient information and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Sep 1, 2023
@oliviertassinari oliviertassinari added the support: Stack Overflow Please ask the community on Stack Overflow label Sep 1, 2023
@github-actions
Copy link

github-actions bot commented Sep 1, 2023

👋 Thanks for using MUI Core!

We use GitHub issues exclusively as a bug and feature requests tracker, however,
this issue appears to be a support request.

For support, please check out https://mui.com/getting-started/support/. Thanks!

If you have a question on Stack Overflow, you are welcome to link to it here, it might help others.
If your issue is subsequently confirmed as a bug, and the report follows the issue template, it can be reopened.

@github-actions github-actions bot closed this as completed Sep 1, 2023
@oliviertassinari oliviertassinari removed the status: waiting for author Issue with insufficient information label Sep 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package: system Specific to @mui/system support: Stack Overflow Please ask the community on Stack Overflow
Projects
None yet
Development

No branches or pull requests

5 participants