No problem! And what I do is to not write anything in the index.js but to export default the actual file in the same directory.
export default
src/components/Tooltip/index.js:
export { default } from './Tooltip'
import Tooltip from '../components/Tooltip'
You can also put a package.json in place of index.js as below:
index.js
src/components/Tooltip/package.json
{ "main": "./Tooltip.js" }
Either way the end goal is to write code in the actual Tooltip.js file.
Tooltip.js
Ahhhh - got it. Thanks! that's a good idea.
No problem :)
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
No problem! And what I do is to not write anything in the index.js but to
export default
the actual file in the same directory.src/components/Tooltip/index.js:
You can also put a package.json in place of
index.js
as below:src/components/Tooltip/package.json
Either way the end goal is to write code in the actual
Tooltip.js
file.Ahhhh - got it. Thanks! that's a good idea.
No problem :)