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

[SpeedDial] unresolved dependencies in TypeScript when following docs #12120

Closed
2 tasks done
itskibo opened this issue Jul 12, 2018 · 4 comments
Closed
2 tasks done

[SpeedDial] unresolved dependencies in TypeScript when following docs #12120

itskibo opened this issue Jul 12, 2018 · 4 comments
Labels
component: speed dial This is the name of the generic UI component, not the React module! typescript

Comments

@itskibo
Copy link
Contributor

itskibo commented Jul 12, 2018

  • This is a v1.x issue (v0.x is no longer maintained).
  • I have searched the issues of this repository and believe that this is not a duplicate.

Expected Behavior

A working speed dial according to the docs when using TypeScript.

Current Behavior

Currently, I get the following error whenever I try to use the speed dial without having @material-ui/icons installed:
Module not found: Can't resolve '@material-ui/icons/Add' in '../node_modules/@material-ui/lab/SpeedDialIcon'

The documentation does not specify that this is required, and it shouldn't be a requirement in my opinion, as this enforces users to use this dependency instead of using something like font awesome.

Steps to Reproduce (for bugs)

  1. create a react app with TypeScript (npx create-react-app app --scripts-version=react-scripts-ts)
  2. add @material-ui/core and @material-ui/lab as dependencies
  3. try to use the SpeedDialIcon component

Codesandbox example: https://codesandbox.io/s/n36wk5xzkp
This does not give the exact same error, but it definitely points towards the same issue.

Context

Wanting to use the speed dial icons without having material-ui/icons as a necessary dependency, as we use generic components for pre-bootstrapped functionality across our application.

Your Environment

Tech Version
@material-ui/core v1.3.1
@material-ui/lab v1.0.0-alpha.5
React v16.4.1
TypeScript v2.9.2
@oliviertassinari oliviertassinari added package: lab Specific to @mui/lab component: speed dial This is the name of the generic UI component, not the React module! labels Jul 12, 2018
@oliviertassinari
Copy link
Member

The documentation does not specify that this is required

@itskibo You should have a peer dependency warning when installing the program. Don't ignore these warnings!

this enforces users to use this dependency instead of using something like font awesome.

It's not an issue. You will only use one icon. The overhead is close zero. You can always provide your own icon with font awesome.

@mbrookes I kind of like this issue suggestion: removing the icons dependency and inline the add icons instead. What do you think?

@mbrookes
Copy link
Member

I agree - just as we do for the core components.

@oliviertassinari oliviertassinari added the good first issue Great for first contributions. Enable to learn the contribution process. label Jul 12, 2018
@mbrookes
Copy link
Member

Sorry, didn't see the "good first issue' `till after I submitted the PR.

@oliviertassinari oliviertassinari removed the good first issue Great for first contributions. Enable to learn the contribution process. label Jul 12, 2018
@oliviertassinari
Copy link
Member

It's fine. I might start picking good first issue in the future if nobody is picking them. We start to have quite some.

@oliviertassinari oliviertassinari added typescript and removed package: lab Specific to @mui/lab labels Jan 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: speed dial This is the name of the generic UI component, not the React module! typescript
Projects
None yet
Development

No branches or pull requests

3 participants