You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Related to #9834
Has this been fixed with the newest single fetch typesafety changes in 2.12.0? (it was mentioned in this PR #9893) I'm using conform and am conditionally using unstable_data when returning a reply with a toast (need to add commit session headers) or without a toast (just a form response)
this is in my action:
if(submission.status!=="success"){return{reply: submission.reply(),}}switch(submission.value.intent){case"create": {const{ name, description, enabled }=submission.valuetry{awaitdb.featureFlag.create({data: { name, description, enabled },})}catch(e){returntoastReply(session,{message: "Feature flag already exists",reply: submission.reply({resetForm: true}),})}returntoastReply(session,{message: "Feature flag created",reply: submission.reply({resetForm: true}),})}case"update": {const{ id, description, enabled }=submission.valueawaitdb.featureFlag.update({where: { id },data: { description, enabled },})returntoastReply(session,{message: "Feature flag updated",reply: submission.reply({resetForm: true}),})}case"delete": {const{ id }=submission.valueawaitdb.featureFlag.delete({where: { id },})returntoastReply(session,{message: "Feature flag updated",reply: submission.reply({resetForm: true}),})}default:
return{reply: submission.reply({resetForm: true}),}}
We just published version 2.12.1-pre.0 which involves this issue. If you'd like to take it for a test run please try it out and let us know what you think!
Reproduction
Tested on my remix project
System Info
Used Package Manager
npm
Expected Behavior
Related to #9834
Has this been fixed with the newest single fetch typesafety changes in
2.12.0
? (it was mentioned in this PR #9893) I'm using conform and am conditionally usingunstable_data
when returning a reply with a toast (need to add commit session headers) or without a toast (just a form response)this is in my action:
and this is the implementation of
toastReply
Actual Behavior
i get an error on
fetcher.data?.reply
when using the action result for conform's server side validationProperty 'reply' does not exist on type '{ type: string; data: { reply: SubmissionResult<string[]>; }; init: { headers?: [string, string][] | Record<string, string> | { append: undefined; delete: undefined; ... 8 more ...; [Symbol.iterator]: undefined; } | undefined; status?: number | undefined; statusText?: string | undefined; } | null; }'.ts(2339)
The text was updated successfully, but these errors were encountered: