Skip to content

Commit

Permalink
[Joy][TextField] Throw error with migration message (#35845)
Browse files Browse the repository at this point in the history
  • Loading branch information
siriwatknp authored Jan 17, 2023
1 parent 97e8753 commit 306b04d
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
8 changes: 8 additions & 0 deletions packages/mui-joy/src/TextField/TextField.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/**
* @ignore - do not document.
*/
export default (function DeletedTextField() {
throw new Error(
'MUI: `TextField` component has been removed in favor of Input composition.\n\nTo migrate, run `npx @mui/codemod v5.0.0/joy-text-field-to-input <path>`.\nFor the codemod detail, visit https://github.com/mui/material-ui/blob/master/packages/mui-codemod/README.md#joy-text-field-to-input\n\nTo learn more why it has been removed, visit the RFC https://github.com/mui/material-ui/issues/34176',
);
});
1 change: 1 addition & 0 deletions packages/mui-joy/src/TextField/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default } from './TextField';
2 changes: 2 additions & 0 deletions packages/mui-joy/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,8 @@ export * from './Tabs';
export { default as Textarea } from './Textarea';
export * from './Textarea';

export { default as TextField } from './TextField';

export { default as Tooltip } from './Tooltip';
export * from './Tooltip';

Expand Down

0 comments on commit 306b04d

Please sign in to comment.