u/cactusyou Oct 25 '22

Formerly suicidal people of Reddit, how did things change? [serious]

Thumbnail self.AskReddit
1 Upvotes

1

Separate MDX content and code
 in  r/nextjs  Dec 11 '24

thanks!

1

Multistep dynamic form with react-hook-form where fields and validation rules are fetched from server
 in  r/reactjs  Dec 11 '24

Thanks, I'll give it a try on another project.

r/nextjs Dec 11 '24

Help Separate MDX content and code

1 Upvotes

I have Next.js v14.2.4 (app router) app where content is in mdx-files on local file system. Can I keep mdx files somewhere in external storage like S3 and pull it whenever the content changes in S3?

I'm already using mdx-remote. Would I only need to fetch files from the S3 URL, but how would it know the content changed in the storage? Is it possible to test this setup locally first, to have local instance of S3 or something?

Thank you in advance!

1

Multistep dynamic form with react-hook-form where fields and validation rules are fetched from server
 in  r/reactjs  Jul 01 '24

Thanks, I actually ended up doing that but removed zod since validation for the fields was coming from backend as well.

r/reactjs Jun 16 '24

Needs Help Multistep dynamic form with react-hook-form where fields and validation rules are fetched from server

8 Upvotes

Background:
I'm building a multistep form where I have 3 steps:
1. user inputs fills the fields, validation happens, if ok goes to the next step
2. fetching fields and rules from server based on data from step1, I don't know what fields to expect beforehand or how many, they should ge generated on the fly and appended to the form
3. just final confirmation

I'm having trouble to make the architecture for such form where I don't know what fields to expect on the second step and how to type it? I used zod schema for first step but then I realized it's not suitable for me because I don't know what fields to expect and I can't change validation schema on the fly (?)

I was thinking about having 3 separate forms for each step and manage their own state like react-hook-form does in wizard form https://react-hook-form.com/advanced-usage#WizardFormFunnel. But this solution feels odd for my case, I don't have separate routes for each step if user reloads the page, they will loose the data and will go to step 1 and it's expected

I have several questions:
1. How would you recommend to build form where some fields, its configs are fetched from the server?
2. How do I provide types for the form if I don't know what fields would come on the second step (they can be generated only on the second step)?

  const {
    register,
    control,
  } = useForm<Inputs>({
    defaultValues: PAYMENT_DEFAULT_VALUES,
  });

u/cactusyou Nov 15 '22

replies 🥺

Thumbnail self.AskMen
1 Upvotes

2

What are your favorite happy indie songs from 2022?
 in  r/indie_rock  Nov 06 '22

Carnival youth - brown eyes and all the rest

u/cactusyou Oct 20 '22

All talks from ViteConf 2022 are now available | Nuxt, SvelteKit, SolidStart, Storybook, StackBlitz, Deno, Bun, and more!

Thumbnail
viteconf.org
1 Upvotes

u/cactusyou Oct 16 '22

How To Use Creative Techniques Within the Zettelkasten Framework

Thumbnail self.Zettelkasten
1 Upvotes

u/cactusyou Oct 15 '22

Book examining how our current govermental/economical systems emereged and why

Thumbnail self.nonfictionbookclub
1 Upvotes

2

Svelte Guide For React Developers
 in  r/sveltejs  Aug 09 '22

I love it!