nwb icon indicating copy to clipboard operation
nwb copied to clipboard

Why do I always get the /es/ folder path when importing in a React app?

Open stevensacks opened this issue 5 years ago • 0 comments

This issue is a:

  • Question / support request

I published my component, of which I only want a single default export. I don't want any of the nested files to be available, but they are.

When I import the default import into a React app, it auto-completes with the following path:

import ReactSmartScroll from 'react-smart-scroll/es/ReactSmartScroll';

But I want it to only be:

import ReactSmartScroll from 'react-smart-scroll;

Because of the /es/ folder path, the nested component ReactSmartScrollRow is available for import, but it should not be exported for use. Only the root level default component.

How do I configure my project so it works like this? Thanks!

Here is my repo: https://github.com/stevensacks/react-smart-scroll

stevensacks avatar May 17 '19 21:05 stevensacks