useful-bronze
useful-bronze10mo ago

I am able to do this with **useEffect**, but every hot reload breaks the state. Not sure why. A solu

I am able to do this with useEffect, but every hot reload breaks the state. Not sure why. A solution is to abuse the successNotification callback and call setData there. Am I overlooking a simpler and better way to do this?
17 Replies
old-apricot
old-apricot10mo ago
Hi all, I’m hoping someone can help me wrap my head around issues with API keys and environment variables in refine. Is it possible to avoid using environment variables that aren’t exposed to the browser (I.e., NEXTPUBLIC). Sorry I looked all around but couldn’t find an answer on how to secure my Airtable provider keys in refine😓
frozen-sapphire
frozen-sapphire10mo ago
Hey, Im new to web development, im trying to connect refine app crm with mongo db? Is it possible?
fascinating-indigo
fascinating-indigo10mo ago
hey guys, im new in refine and i was making the tutorial of supabase pixels. So i was making the admin dashboard and the sider doesn't show the "canvases" and "users" pages. and if i go to the /users page doesn't show the table. idk if could be a error with the supabase config or im missunderstanding something with refine. to give more context i literally copy the files from the git repo but isn't working the sider only show the logo and the "Logout" button. the resources are defined well. the data base has the same squema of the example
adverse-sapphire
adverse-sapphire10mo ago
Hello All, I have a form that suddenly doesn' t work I have been upgrading the project to 4 and am pretty sure it was working after a upgrade for a while. Clicking the button doesn't do anything at all.
return (
<Form key="UploadDocumentForm" onSubmitCapture={(handleSubmit(onSubmit))}>
<Form.Item
label="Assignee: "
name="fullName"
id="fullName"
rules={[{ required: true, message: 'Please input assignee name!' }]}
>
<Input />
</Form.Item>

<CreateButton value="Submit" disabled={isUploading} />
</Form >
);
};
return (
<Form key="UploadDocumentForm" onSubmitCapture={(handleSubmit(onSubmit))}>
<Form.Item
label="Assignee: "
name="fullName"
id="fullName"
rules={[{ required: true, message: 'Please input assignee name!' }]}
>
<Input />
</Form.Item>

<CreateButton value="Submit" disabled={isUploading} />
</Form >
);
};
I am using Form tag from antd and useForm hook for react-hook. Thanks for your help!
extended-salmon
extended-salmon10mo ago
Hello, i have a question, does refine mock database in graphql resetted?
sensitive-blue
sensitive-blue10mo ago
Hello! I'm trying to be a good Refine citizen and go through the proper channels. I had a refine-specific question and asked in the ask-any-question channel, but the bot was unable to resolve my issue. Is there a respectable way to try and escalate a question to a real person? I see the questions channel was archived.
conscious-sapphire
conscious-sapphire10mo ago
Hello, I am from Canada and coming from Outsystems which is a low code platform. Ever since I started using Outsystems I have felt like the time saved on the easy stuff was just spent on hacking the platform to do something custom for the client. I really like how refine is finding a way to make that repetitive CRUD stuff easier, but without sacrificing the all the genius that has come from the tech industry as a whole. For example one of our clients just got bought by another company and now they want every instance of the old company name replaced in the code base. This would be trivial with a bit of grep and a test suite to verify nothing broke. Alas we will have to manually find every instance and change it. None the less the company I work for is doing very well being able to deliver the 80% so fast, I am wondering if any one is having success in their company using refine. I would love to hear about what it's like in production!
extended-salmon
extended-salmon10mo ago
Hey, how do you run cypress tests in refine/examples? When I try to run cypress in any example, I get same error as in issue https://github.com/cypress-io/cypress/issues/8599. I managed to solve it by: 1. exporting refine/cypress/support/e2e.ts 2. creating fixCypress.ts in refine/examples/specific-example and importing mentioned export 3. pointing cypress.config.ts: supportFile (in specific example) to newly created fixCypress.ts Is anyone else encountering same error or am I doing something wrong?
fascinating-indigo
fascinating-indigo10mo ago
Any chance that the fake rest api source will be available?
molecular-blue
molecular-blue10mo ago
Hi! Can somebody help with one thing that I couldn't resolve with kapa? In my app I have an accessControlProvider, and it works fine with all the resources and actions. The problem is with the routes that are not asociated with a resource or with an action that is not in the default list, for example I have created a custom route, that has nothing to do with any resource, and when I access to this route, my can function is executed with undefined resource and empty action. How can I to avoid to run the can function in this case? or how can I receive the correct action or resource? right now I edited my can function to return {can: true} if the action is not in ["list", "create", "edit", "show", "delete"] but I think that is not the best behavior. Thanks!
exotic-emerald
exotic-emerald10mo ago
Hello, I originally asked this question to kapa, which suggested I reach out to the wider community: I want to create a dynamic list of resources available to the user at login time by fetching a list of their permissions from a backend server. Is there a way to add resources to the IResourceItem list provided to the <Refine> tag after its instantiation? Or to not provide a resources property to <Refine> initially and then set it later? The goal is to dynamically construct the menu options for a <ThemedLayoutV2> component as well as setup the associated routes based on user permissions with a call to my data provider. Another question - one that seems like it should be way simpler. I'm trying to create a component that will send a custom query up to my backend server every time the user performs a search on an ant design <Search> field. But I'm running into an error currently of "Invalid hook call. Hooks can only be called inside the body of a function". Code is below:
import { useCustom, useOne } from "@refinedev/core"
import { Col, Input, Row } from "antd"
import { API_BASE_URL } from "../../providers";

const { Search } = Input;

export const Home = () => {

const spotlightSearch = (value) => {
const { data, isLoading } = useCustom({
url: `${API_BASE_URL}/spotlight`,
method: 'post',
config: {
payload: value
}
});
console.log(data);
};

return (
<div>
<Row gutter={[32, 32]}>
<Col xs={24} sm={24} xl={24}>
<Search name="searchFun" placeholder="Provide a search term..." enterButton="Search" size="large" onSearch={(value, event) => {
spotlightSearch(value);
}} />
</Col>
</Row>
<Row gutter={[32, 32]}>
<Col xs={24} sm={24} xl={24} style={{ marginTop: '32px' }}>
<div id="spotlightResults"></div>
</Col>
</Row>
</div>
)
}
import { useCustom, useOne } from "@refinedev/core"
import { Col, Input, Row } from "antd"
import { API_BASE_URL } from "../../providers";

const { Search } = Input;

export const Home = () => {

const spotlightSearch = (value) => {
const { data, isLoading } = useCustom({
url: `${API_BASE_URL}/spotlight`,
method: 'post',
config: {
payload: value
}
});
console.log(data);
};

return (
<div>
<Row gutter={[32, 32]}>
<Col xs={24} sm={24} xl={24}>
<Search name="searchFun" placeholder="Provide a search term..." enterButton="Search" size="large" onSearch={(value, event) => {
spotlightSearch(value);
}} />
</Col>
</Row>
<Row gutter={[32, 32]}>
<Col xs={24} sm={24} xl={24} style={{ marginTop: '32px' }}>
<div id="spotlightResults"></div>
</Col>
</Row>
</div>
)
}
If I just call spotlightSearch("<something I know will give results>"); right after the function declaration, everything works correctly and I get back the data I'm expecting. So I'm hoping I'm just doing something trivially wrong in my syntax or something. I'm still very new to Refine - and react in general.
rival-black
rival-black10mo ago
hi guys, any official Example repos involving the following stack with refine? Ant Design + Supabase + Next.js?
flat-fuchsia
flat-fuchsia10mo ago
Hi, I'm stuck while trying to re create the backend for the CRM example (really don't understand wjhy the team is reluctant to make it public). Could someone help me out with it, please?
xenial-black
xenial-black10mo ago
Hello guys, first of all thanks for an amazing project. I asked a question in ask-any-question channel but bot didn't answer correctly on it can I ask devs if there is available anybody?
rival-black
rival-black10mo ago
They’ll respond when they’ll have an answer
harsh-harlequin
harsh-harlequin10mo ago
Hello. My name is Mateo. Handle is Flutterbots. I was introduced to Refine.dev and cannot believe it. Nice work! We're currently using Angular but I'm a React developer. I'm a technical lead at my company and I am working on a POC to see if Refine will work as the architecture for our product. I'm following the example on the website for the authentication piece but I'm getting this error: "Warning: validateDOMNesting(...): <form> cannot appear as a descendant of <form>." Looking for help to get it resolved. But I'm also new here and so please tell me if I need to do something differently. Thanks!
conscious-sapphire
conscious-sapphire10mo ago
I just have a question why the vite template doesn't include i18n when using the CLI?