Skip to content

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

@abalirac

Description

@abalirac

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions