Import with import filename from 'folder path';

Asked 1 years ago, Updated 1 years ago, 321 views

I saw that the code drawn in React is used as follows, but since the export name is Index, import Index from 'hoge'; looks correct. Can I still use the Index component like <hoge/>?
I would appreciate it if you could let me know the details.Thank you for your cooperation.

hoge/index.tsx

const Index:React.FC<Props>=route=>{}

export default Index;

Load to

import hoge from 'hoge';

javascript reactjs react-router-dom

2022-09-30 22:04

1 Answers

This export default only allowed you to use any name.

Reference

What is export default


2022-09-30 22:04

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.