R
Refine

ask-any-question

Do resource interfaces have to be interfaces?

Eextended-salmon1/16/2023
Hi! I've followed the documentation while creating a Refine app and when I sent it for review one of reviewers(my coworker) told that the interfaces(the ones that represent resources) are not actually interfaces, because they are not used in our app to implement any classes. This means we can actually change them to be types and not interfaces. So the question is: why does the documentation has them as interfaces? Is it a requirement?
Bbroad-brown1/16/2023
Type and interface have technically different but not so much. TypeScript not strict as other oop languages. Most of time you don't encounter a problem with type or interface. Besides technical aspect, Developers have opinions, conventions and preferences. You can use type if you want. This is not a requirement. if it's, TypeScript will throw errors anyway.
Eextended-salmon1/16/2023
Sure, it doesn't matter much technically, I was talking more about the semantics and conventions. So, in the documentation it is written as interface just because of preference?
Bbroad-brown1/16/2023
Our core lead members can explain this in more detail 🙏 when they available I'm pretty sure they will happy the answer logo talk with core team, it just a preference
Eextended-salmon1/16/2023
Got it, thanks a lot, @alicanerdurmaz !

Looking for more? Join the community!

R
Refine

ask-any-question

Join Server
Recommended Posts
Change content-type depending on we need to edit or to create a ressourceI implemented the edit and the create possibility in my refine application. My API need the `applicaMulti level menu without nested URLI am using the following document to create nested items in the sidebar, but the URL of the nested ipermanent filter not getting applied idf its nestedthis is useTAble const { tableProps, setFilters } = useTable({ resource: "packages", metaDaI have a form field which is a nested Object how can I use `useDrawerForm` to create entry?I have a form field which would have dynamic fields based on an Object Array something like this [{'export 'App' (reexported as 'App') was not found in 'antd'After I have updated my refine-antd package from ``` "@pankod/refine-antd": "^4.1.0", "@pankod/refuseDrawerForm with additional parametersHi there, I am trying to use `useDrawerForm` . I have cards for different product type/categories. Atype 'FormPropsType'Getting this error message when following the guide - ERROR in src/App.tsx:81:17 TS2322: Type '{ iniuseTable Typing error is unkownGetting full typing expect for `error` : ```js import { useTable } from "@pankod/refine-react-table"BackdndHello there! I´m back on working on my project with Refine. The thing is that I chose strapiv4 as baPersistQueryClientHi! I would like to try using https://tanstack.com/query/v4/docs/react/plugins/persistQueryClient wiqueryOptions.enabledI am using Hasura/GraphQL with Ant Design and my hooks appear to still run queries even if `queryOptHey there I m having a hard time workingHey there! I'm having a hard time working around useTable() or useList(), such that the api I'm usin