Amir Hossein Hashemi
Amir Hossein Hashemi
Explore posts from servers
SSolidJS
Created by Amir Hossein Hashemi on 12/31/2024 in #support
Why submission result doesn't update?
This way [I think] we lose progressive enhancement and it's a lot of code compared to using action. Maybe a better approach would be to always return something from the action if the result is used:
const addPost = action(async (formData: FormData) => {
const title = formData.get("title") as string;
if (!title || title.length < 4) {
return {
isError: true,
error: "Title must be at least 4 characters",
};
}
return { isError: false }; // <- added this
}, "addPost");
const addPost = action(async (formData: FormData) => {
const title = formData.get("title") as string;
if (!title || title.length < 4) {
return {
isError: true,
error: "Title must be at least 4 characters",
};
}
return { isError: false }; // <- added this
}, "addPost");
8 replies
SSolidJS
Created by Amir Hossein Hashemi on 12/31/2024 in #support
Why submission result doesn't update?
Thank you @peerreynders for your informative response.
So you should get into the habit on clearing submissions that carry data (error or result) once you've retained the necessary information in order to not be confused by stale entries later on.
Can you please explain how this should be done in my example code? I'm aware of the clear method, but I don't know the best practice on where to call it.
8 replies
RRefine
Created by harsh-harlequin on 11/8/2023 in #ask-any-question
How to disable authentication in a page?
@kapa.ai The window object is not available in the server. Considering I'm using SSR this might be a problem
12 replies
RRefine
Created by adverse-sapphire on 11/8/2023 in #ask-any-question
How to disable authentication in a page?
@kapa.ai I want to completely disable authentication for a specific page. What should I do?
12 replies
RRefine
Created by homely-rose on 10/20/2023 in #ask-any-question
Why useDelete calls getIdentity from auth-provider?
Hey @Omer . Thank you for the help. I was going to open an Issue but I saw a commit that addresses it. Looking forward for it being shipped in the next release.
26 replies
RRefine
Created by provincial-silver on 10/20/2023 in #ask-any-question
Why useDelete calls getIdentity from auth-provider?
@kapa.ai No I don't call any auth-provider's method in my data-provider. I have an access-control-provider too but it also doesn't use auth-provider's methods
26 replies
RRefine
Created by xenial-black on 10/20/2023 in #ask-any-question
Why useDelete calls getIdentity from auth-provider?
@kapa.ai What do you mean by "specific behavior of your data provider or auth provider." This is my auth-provider:
26 replies
RRefine
Created by eastern-cyan on 10/20/2023 in #ask-any-question
Why useDelete calls getIdentity from auth-provider?
@kapa.ai I've narrowed down the issue to the useDelete hook. I don't render anything else in the screen but still the ["getUserIdentity"] query is being called for each button.
26 replies
RRefine
Created by constant-blue on 10/20/2023 in #ask-any-question
Why useDelete calls getIdentity from auth-provider?
@kapa.ai But I'm not using <Edit> and any component from the component libraries that refine supports. Anywhere else uses meta.canDelete ?
26 replies
RRefine
Created by quickest-silver on 10/20/2023 in #ask-any-question
Why useDelete calls getIdentity from auth-provider?
@kapa.ai I'm not using the <DeleteButton> component and I'm not using useCan or useIdentity in a relevant component. But in the docs you pass a meta.canDelete property to resources prop in the <Refine> component. I've removed it. Could it be the cause of the problem?
26 replies
RRefine
Created by eastern-cyan on 1/6/2023 in #ask-any-question
Reducing bundle size
10 replies
RRefine
Created by deep-jade on 1/6/2023 in #ask-any-question
Reducing bundle size
Sure
10 replies
RRefine
Created by plain-purple on 1/6/2023 in #ask-any-question
Reducing bundle size
But it's not possible with @pankod/refine-mui. Does that effect the bundle size? I guess tree-shaking takes care of that but I'm not sure.
10 replies
RRefine
Created by fair-rose on 1/6/2023 in #ask-any-question
Reducing bundle size
import Button from "@pankod/refine-mui/Button";
import Button from "@pankod/refine-mui/Button";
10 replies
RRefine
Created by fascinating-indigo on 1/6/2023 in #ask-any-question
Reducing bundle size
but material ui suggests to import it with default export to reduce the bundle size:
10 replies
RRefine
Created by absent-sapphire on 1/6/2023 in #ask-any-question
Reducing bundle size
import { Button } from "@pankod/refine-mui";
import { Button } from "@pankod/refine-mui";
10 replies
RRefine
Created by automatic-azure on 1/6/2023 in #ask-any-question
Reducing bundle size
The other thing is, I'm currently importing material ui with named exports:
10 replies
RRefine
Created by dependent-tan on 12/12/2022 in #ask-any-question
I can't serve the app from a sub-directory
6 replies
RRefine
Created by fascinating-indigo on 12/12/2022 in #ask-any-question
I can't serve the app from a sub-directory
Sure. I'm gonna create an issue right now. Thanks for the confirmation
6 replies
RRefine
Created by variable-lime on 12/12/2022 in #ask-any-question
I can't serve the app from a sub-directory
Thanks. let me know if you need more information
6 replies