Rafael Hengles
Rafael Hengles
Explore posts from servers
RRefine
Created by ambitious-aqua on 5/3/2023 in #ask-any-question
dynamic i18n resource route prefix path
I already configured the router package (react-router-dom v6) to add a "lang" path prefix to my app, so I can have these routes for example: - /en/posts - /es/posts - /fr/posts - etc... But now I have to configure the resources property in the <Refine> component, and I don't know how I can make these two things work together, as it seems that these paths must be static. I still don't understand fully in which circumstances these paths are used by Refine, as I don't use them in my menu navigation components. I also tried searching here and in github but didn't find anything related.
21 replies
RRefine
Created by metropolitan-bronze on 3/20/2023 in #ask-any-question
AuthPage does not handle any errors
Does the default AuthPage do any error handling by default ? I return an error in my authProvider login() function like this:
return {
success: false,
// error: new Error("Invalid email or password"), // first example in docs I saw
error: {
name: `Could not log in`, // second example
message: String((error as any)?.message || error || `Error`)
}
};
return {
success: false,
// error: new Error("Invalid email or password"), // first example in docs I saw
error: {
name: `Could not log in`, // second example
message: String((error as any)?.message || error || `Error`)
}
};
But the error does not appear on screen. To show the errors to the user is it required to swizzle this component ? I'm using the headless UI mode. Are the errors shown through notificationProvider ?
6 replies
RRefine
Created by conscious-sapphire on 3/20/2023 in #ask-any-question
Data provider requests in loop when using Vite
No description
11 replies
RRefine
Created by rival-black on 3/17/2023 in #ask-any-question
query data cannot be undefined
I created a new Refine app, using the Remix framework and Headless components. I tried to implement a small /logout route that doesn't exist in the template. It was a little hard because I'm not used to Remix but I did make a page that erases the user cookie on the client and redirects to the login page. But now I'm getting this message on the browser console that I can't find the source. Apparently it is coming from Tanstack Query, but I'm not using that directly.
chunk-AXEPKFYX.js:4742 Query data cannot be undefined. Please make sure to return a value other than undefined from your query function. Affected query key: ["getUserIdentity"]
chunk-AXEPKFYX.js:4742 Query data cannot be undefined. Please make sure to return a value other than undefined from your query function. Affected query key: ["getUserIdentity"]
I also searched for this key "getUserIdentity" on my code but it doesn't exist there.
16 replies
RRefine
Created by extended-salmon on 1/19/2023 in #ask-any-question
Can't use other locale on DateFields from Inferencer
For example, I'm building an app with Mantine. The docs says this: https://refine.dev/docs/api-reference/mantine/components/fields/date/
If you need other locales, you can load them on demand. Refer to loading locales
But there's two problems: (1) The inferencer calls <DateField value={...} />, it doesn't ask about locales. (2) The dayjs lib is not exposed on windowor as a global variable, as the docs above seems to imply (also is the method on the source Dayjs' docs to import other locales, loading from a global variable in the browser into another global variable). This is about i18n but this is not provided by i18nProvider, that's the closest tag available for this post.
4 replies