Comments (3)
@aliemir Ideally there'd be a lint rule to protect you against duplicate names, but there don't seem to be any good options.
My advice is to adopt a naming convention for each of your packages. Add a prefix or suffix to distinguish between two similar, but separate entities. Example ButtonBase and Button.
When you have decided on a convention it can be enforced with https://typescript-eslint.io/rules/naming-convention/#prefix--suffix where each one of your packages will have the rule configured differently.
The end result would be that you can safely import:
// before
import { UseFormProps } from "@refinedev/core";
import { UseFormProps } from "@refinedev/react-hook-form";
// after
import { UseFormPropsCore } from "refinedev/core";
import { UseFormPropsHookForm } from "@refinedev/react-hook-form";
I hope you'll be able to come up with a more elegant solution, but this is the best option I can think of atm.
from refine.
Hey @borisyordanov, We have UseFormProps in both @refinedev/core and @refinedev/react-hook-form. Additionally, we have useForm in both as well. The latter is an extended version of the former. If you're going to extend the one from @refinedev/react-hook-form
you'll need to use the UseFormProps
from that package as well.
I think I understand the confusion here, we might need to rename them to be explicit 🤔 Do you have any suggestion how we can avoid confusion here? 🙏
from refine.
Hey @borisyordanov, thank you for the suggestion. We've discussed with the team and decided not to take any actions for now about the naming conventions. In the future, there may be changes related to how we export things and changes in the naming may cause issues with those.
Thank you for reporting, closing this issue for now. I'll update here and mention this issue when we have related changes planned/implemented. 🙏
from refine.
Related Issues (20)
- [FEAT] Pro Components for Ant Design HOT 1
- [DOC] Tutorial with Material UI is broken
- [FEAT] TS-Rest Data Provider HOT 2
- [BUG] default MUI theme shrinks the main content when sidebar is open initially, but not whenever the sidebar is opened after that HOT 2
- [FEAT] Make it EASY to code for medusa
- [BUG] `invalidates` prop of `useUpdateMany` doesn't work
- [BUG] redirect in useForm refineCoreProps doens't work HOT 4
- [BUG] Typo in examples/app-crm-minimal code snippets graphql/queries.ts HOT 4
- [BUG] `<DateField value={undefined} />` is still displaying the date HOT 6
- [BUG] Element Selector in Devtools causing crash through `e.getBoundingClientRect is not a function` HOT 5
- [FEAT] after generating resources with `refine add resource` command, `@refinedev/inferencer` package is missing.
- [BUG] Type error when functions are passed to `optionLabel` and `optionValue` in `useSelect`
- [BUG] `refine add resource` generating invalid React component name
- [BUG]Supabase data provider returns wrong sorted list for foreign table colmun HOT 2
- [BUG] Nested CrudFilters values with Supabase not correctly parsed HOT 2
- [FEAT] replace `preferred-pm` with `package-manager-detector` HOT 2
- [BUG] Keycloak auth not working, redirecting back to login HOT 1
- [FEAT] Add support to `and`, `or`, `between`, `null` and `nnull` operators in `@refinedev/appwrite` HOT 2
- [BUG] Unable to implement custom queryclient for invalidating custom queries HOT 1
- [BUG] `queryOptions.enabled` causes `undefined` request to be sent in `useForm`
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from refine.