-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Product quiz TS migration #116
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The extension doesn't work - ts needs to be compiled and theme extensions don't do that (without a Vite plugin)
shopify/product-quiz-template/extensions/quiz/assets/product-quiz.ts
Outdated
Show resolved
Hide resolved
Co-authored-by: Riley Draward <[email protected]>
…o product-quiz-ts
Waiting on Nic to help me with that id issue. (quiz update) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I cannot wait until we can rip most of this out for a simple AutoForm
🎩 ✅
some comments on typing in the frontend, but approving pending updates
@@ -74,7 +79,9 @@ export default ({ | |||
requiredIndicator | |||
label="Name" | |||
autoComplete="off" | |||
error={errors.quiz?.title?.message} | |||
error={ | |||
(errors.quiz as { title?: { message: string } })?.title?.message |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This feels like we should be passing in typing to useFormContext
instead of using as
here
@@ -89,7 +96,9 @@ export default ({ | |||
requiredIndicator | |||
label="Description" | |||
autoComplete="off" | |||
error={errors.quiz?.body?.message} | |||
error={ | |||
(errors.quiz as { body?: { message: string } })?.body?.message |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same comment as above, typing on useFormContext
vs as
error={errors.quiz?.questions?.[i]?.text?.message} | ||
error={ | ||
( | ||
errors.quiz as { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same comment, useFormContext
typing vs as
Adding type declarations and definitions for migration to ts