I have imported the component of Name StoryBook that is exported default name.
But is also works as StoryBookX.
e.g
import StoryBook from ‘storybook’, // This is default name.
import StoryBookX from ‘storybook, //This is not default name but it also work.
Can anybody explain that what the reason of it.
<View>
<StoryBook />
</View>
<View>
<StoryBookX />
</View>
Both are wokring while there is no default component of name StoryBookX
2
Answers
When you export component as default then you can import it by different name also.
yes. if we have a component Like
then we can export it with different names like this,