Derek
Derek
Explore posts from servers
RRefine
Created by stormy-gold on 9/21/2023 in #ask-any-question
How can I just see the current fields value?
So this seems like a really dumb question, but using refine, its really difficult to use the value of a field. What I mean by that is I want to check if a checkbox is checked, if its checked, I want to show additional fields. Problem is, I cant find the actual value that updates as I'm toggling the checked box:
<Form.Item
label="Is Limited Edition"
valuePropName="checked"
name={["is_limited_edition"]}
>
<Checkbox>Is Limited Edition</Checkbox>
</Form.Item>
<Form.Item
label="Is Limited Edition"
valuePropName="checked"
name={["is_limited_edition"]}
>
<Checkbox>Is Limited Edition</Checkbox>
</Form.Item>
How can I get the value of is_limited_edition?
5 replies
RRefine
Created by foreign-sapphire on 8/25/2023 in #ask-any-question
How to transform a value before it gets sent for a resource update
Hi all! As the title states, I would like to know what the best practice is for transforming a value before it gets sent to the server to update a resource. Code:
export const ArtistEdit: React.FC<IResourceComponentsProps> = () => {
const { formProps, saveButtonProps, queryResult } = useForm();
const artistsData = queryResult?.data?.data;

return (
<Edit saveButtonProps={saveButtonProps}>
<Form.Item
label="Date Of Birth"
name={["date_of_birth"]}
rules={[
{
required: true,
},
]}
getValueProps={(value) => ({
value: value ? dayjs(value) : undefined,
})}
>
<DatePicker />
</Form.Item>
</Edit>

)

}
export const ArtistEdit: React.FC<IResourceComponentsProps> = () => {
const { formProps, saveButtonProps, queryResult } = useForm();
const artistsData = queryResult?.data?.data;

return (
<Edit saveButtonProps={saveButtonProps}>
<Form.Item
label="Date Of Birth"
name={["date_of_birth"]}
rules={[
{
required: true,
},
]}
getValueProps={(value) => ({
value: value ? dayjs(value) : undefined,
})}
>
<DatePicker />
</Form.Item>
</Edit>

)

}
In this code sample, I need to make sure the value of date_of_birth conforms to the backends requirement for date parsing. What is best practice here to do when working solely with refine?
5 replies
RRefine
Created by conscious-sapphire on 8/18/2023 in #ask-any-question
How do I use `useEditableTable` with my own custom data fetcher/update logic?
Essentially, I want to use the useEditableTable hook without a resource. I have backend call that can fetch all my models; and I have another one that can update a model
19 replies
RRefine
Created by ambitious-aqua on 7/6/2023 in #ask-any-question
whats best practice for customizing document title on a specific resource route?
Essentially, I have a show route that I want the document title to be "{name of user} Artist Review | MyService" instead of what it currently is, which is "#1 Show Review Artist | MyService" what is the best practice for this?
5 replies
TTCTheo's Typesafe Cult
Created by Derek on 6/28/2023 in #questions
Year old IntelliJ bug is actively making my development experience miserable
IntelliJ has had some type of CPU bug while trying to parse mildly complex Typescript types for about a year now. Its an IDE & machine stopper. I've personally seen CPU spikes up to 800+%. The Jetbrains team has been less than responsive on this issue and it seems like there is no urgency to fix it. I am posting here in order to gain some type of traction or...to sadly convince me to finally move on.. https://github.com/d-pollard/intellij-typescript-cpu-issue Does anyone have any suggestions on how to make VSCode as close of an integrated experience as IntelliJ ULTIMATE?
2 replies