web icon indicating copy to clipboard operation
web copied to clipboard

Import structure is being detected as circular dependencies

Open wesgro opened this issue 3 years ago • 0 comments

Prior Issues

Are there any existing issues or PRs that relate to this problem? If so, link them here.

What is the current behavior?

Hooks all import dependencies from ../ (or the index.js file) which also exports all the hooks. This is being detected as a circular dependency in our build system.

What is the expected behavior?

Instead of importing from ../ the hooks should import from the dependant hook file directly

For example: import { useRafCallback } from '..'; becomes import { useRafCallback } from '../useRafCallback/useRafCallback';

Environment Details

  • _@react-hookz/web version: 15.0.1
  • _react version: 17.0.1
  • _react-dom version: 17.0.1
  • _typescript version: 4.5.2
  • _Did this work in previous versions? unknown but probably not

wesgro avatar Aug 23 '22 21:08 wesgro