Getting error when creating a new hook inside refine-core
I have created a new hook inside refine-core/hooks. now I tried to use it inside core-select-example. but its showing module not found. I looked inside the folder and it's there. Can't figure it out. I am using the repo.
![No description](https://cdn.answeroverflow.com/1070424990576554035/image.png)
![No description](https://cdn.answeroverflow.com/1070424991012749473/image.png)
2 Replies
frozen-sapphire•2y ago
Hi @sebabratakundu,
Your import path doesn't seems correct.
you can export your hook from here:
https://github.com/refinedev/refine/blob/next/packages/core/src/index.tsx
and import like that
sorry, actually all
import {useDocumentTitle} from "@pankod/refine-core"
/hooks
folder is already exported.
you can export from here:
https://github.com/refinedev/refine/blob/next/packages/core/src/hooks/index.ts
and import like that
import {useDocumentTitle} from "@pankod/refine-core"
~~
For the integrity of the project, the folder structure of all hooks should be the same. Also, it will be the easy to export
like thisstormy-gold•2y ago
thanks @alicanerdurmaz .