question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Export `createSvgIcon` from `@material-ui/icons`

See original GitHub issue
  • I have searched the issues of this repository and believe that this is not a duplicate.

Summary 💡

Export createSvgIcon function from @material-ui/icons to be able to create custom icons while reusing the createSvgIcon function.

Examples 🌈

import { createSvgIcon } from '@material-ui/icons'

Motivation 🔦

It would be great to reuse the createSvgIcon function in other projects. It is possible to import the function by

import createSvgIcon from '@material-ui/icons/utils/createSvgIcon';

but it is an internal function so the API may change anytime soon without any warning.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
oliviertassinaricommented, Mar 25, 2020

You’re talking about internal usage which is quite different from public release.

@eps1lon Well, I believe we have no precedent of importing private modules between @material-ui/x packages, but I don’t see anything wrong with it, as we can control these imports (not the case when in third-parties code) 😃.

What do you think of refactoring “lab” and “icons” to follow the approach of “pickers”? I would reduce the bundle size (deduplication for private usage).

0reactions
oliviertassinaricommented, Mar 25, 2020

@darkowic For the public aspect, I think that we could delay the effort to a point where we have more user requests. Also, I think that we should look into how it fits with the SVGR ecosystem before moving forward.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Export createSvgIcon from @material-ui/icons #20268 - GitHub
Export createSvgIcon function from @material-ui/icons to be able to create custom icons while reusing the createSvgIcon function.
Read more >
javascript - material-ui 'createSvgIcon' is not exported from ...
js Attempted import error: 'createSvgIcon' is not exported from '@material-ui/core/utils'. So I tried to google this problem and found another ...
Read more >
React Icon Component - Material UI - MUI
For each SVG icon, we export the respective React component from the @mui/icons-material package. You can search the full list of these icons....
Read more >
[Solved]-material-ui 'createSvgIcon' is not exported from ...
Coding example for the question material-ui 'createSvgIcon' is not exported from '@material-ui/core/utils'-Reactjs.
Read more >
UNPKG - @material-ui/icons
1, import SvgIcon from '@material-ui/core/SvgIcon';. 2. 3, declare function createSvgIcon(path: React.ReactNode, displayName: string): typeof SvgIcon;.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found