Issue: Documentation Discrepancy: Importing Material-UI Input in React Hook Form
TanzimHossain2 opened this issue · 1 comments
Version Number
7.48.2
Codesandbox/Expo snack
https://codesandbox.io/s/react-hook-form-with-ui-library-forked-fp5r3
Steps to reproduce
- Go to 'https://react-hook-form.com/get-started'
- Follow the React Hook Form documentation.
- Attempt to import Material-UI Input using the provided syntax.
- Encounter the internal server error as mentioned.
When following the documentation for React Hook Form and attempting to import the Material-UI Input component using the provided example:
import Input from "@material-ui/core/Input";
An error is encountered in the Vite environment:
[vite] Internal server error: Failed to resolve import "@material-ui/core/Input" from "src\\App.jsx". Does the file exist?
Important Note:
The documentation currently references Material-UI v4, which has been deprecated since September 2021. The latest version is "@mui/material" v5.14.18. Importing using the Material-UI documentation syntax (import { Input } from '@mui/material';
) is recommended for the latest version.
Expected behaviour
The Material-UI documentation recommends a different import syntax that works without errors in the Vite environment:
import { Input } from '@mui/material';
Additional Information:
- The error occurs specifically in the Vite environment.
- Importing using the Material-UI documentation syntax (
import { Input } from '@mui/material';
) does not produce an error.
Material-UI Version Information:
- The documentation currently references Material-UI v4.10.2.
- Material UI v4 has been deprecated since September 2021.
- The latest version is "@mui/material" v5.14.18.
Documentation Update:
Developers are advised to update the documentation to reflect the correct import syntax for Material-UI v5. The Material-UI team provides a migration guide to upgrade from v4 to v5: [Material-UI Migration Guide](https://mui.com/material-ui/migration/migration-v4/)
What browsers are you seeing the problem on?
Firefox, Chrome, Edge
Relevant log output
No response
Code of Conduct
- I agree to follow this project's Code of Conduct
Unfortunately, the Codesandbox dependency tree only detects MUI "v5.0.0-beta.5" as the most recent MUI version available, preventing us from upgrading at the moment.