react-hook-form / documentation

📋 Official documentation
http://react-hook-form.com
MIT License
726 stars 1.04k forks source link

Issue: Documentation Discrepancy: Importing Material-UI Input in React Hook Form #1028

Closed TanzimHossain2 closed 1 year ago

TanzimHossain2 commented 1 year ago

Version Number

7.48.2

Codesandbox/Expo snack

https://codesandbox.io/s/react-hook-form-with-ui-library-forked-fp5r3

Steps to reproduce

  1. Go to 'https://react-hook-form.com/get-started'
  2. Follow the React Hook Form documentation.
  3. Attempt to import Material-UI Input using the provided syntax.
  4. 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.

image

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:

Material-UI Version Information:

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/)

image

What browsers are you seeing the problem on?

Firefox, Chrome, Edge

Relevant log output

No response

Code of Conduct

Moshyfawn commented 1 year ago

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.