-
Notifications
You must be signed in to change notification settings - Fork 91
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
[bug] @material-ui/lab shouldn't be required when not using Autocomplete #142
Comments
Thanks for the report. I noticed this as well. If you have ideas on how to solve this short of building every single component as its own package, that would be great. |
Maybe @material-ui/lab could be included as an optional dependency in package.json, then imported using require() inside the Autocomplete function. See https://npm.github.io/using-pkgs-docs/package-json/types/optionaldependencies.html. |
Yea, that or a peerDependency. Would you like to experiment and tell me which one is best? |
I would say this is duplicate of #138 |
Optional seemed to work! |
This is actually not fixed... |
Storing this here for later consideration: https://github.com/pikapkg/pack |
Adding this here to document it. With a clean install in a new project. The |
Closing, haven't found a need to fix this in years... |
The readme says to run
yarn add mui-rff @material-ui/core @material-ui/pickers final-form react-final-form
to install all required dependencies. It also says to runyarn add @material-ui/lab
if using Autocomplete. I created a basic login form using MUI-RFF with only the TextField (no Autocomplete).import { TextField } from "mui-rff";
However, I got a compilation error when building my project.
Module not found: Can't resolve '@material-ui/lab/Autocomplete' in '/node_modules/mui-rff/dist'
I therefore had to install @material-ui/lab.
Expected behavior
@material-ui/lab shouldn't be required unless Autocomplete is imported from "mui-rff".
The text was updated successfully, but these errors were encountered: