Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[DOCS]: useRouter should be imported as a named export, not a default export #15

Open
abalirac opened this issue Jan 27, 2025 · 0 comments

Comments

@abalirac
Copy link

Description

The documentation for @unitools/router incorrectly shows useRouter as a default export. However, in the latest version, useRouter is a named export. This discrepancy is causing confusion and errors.

Steps to Reproduce

  1. Follow the documentation at unitools router documentation to import useRouter as a default export:
    import useRouter from '@unitools/router';
  2. Attempt to use the useRouter hook in a component.

Expected Behavior

The useRouter hook should be imported and used without any errors.

Actual Behavior

The following error is thrown:

TypeError: _unitools_router__WEBPACK_IMPORTED_MODULE_16__["default"] is not a function

Additional Information

Here is the correct way to import useRouter:

import { useRouter } from '@unitools/router';

Environment

  • @unitools/router version: 0.0.6
  • Node.js version: 22
  • Operating System: windows 10
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant