I have the following code where I export a component , and I want to force the imported name to be the same as the file, this issue with default behavior is that some times you change the file name and the component name yet the olde import name don’t error out, and this would result in confusion when someone want to recognize the complex components what it the best way to disable this behavior ?
MyComponent.tsx:
const MyComponent: React.FC<Props> = ({ /* props */ }) => {
// component logic
};
export default MyComponent;
AnotherFile.tsx:
import MyComponentX from './MyComponent';