Remix Single: Clearing Inputs After Form Submissions

  Рет қаралды 25,432

Remix

Remix

Күн бұрын

Пікірлер: 21
@seanmcdonald8998
@seanmcdonald8998 3 жыл бұрын
Loving these singles. Reinforcing some stuff I already knew plus teaching plenty I didn't know about 👍
@carloslouredaparrado8915
@carloslouredaparrado8915 3 жыл бұрын
Oh man. You are killing it with this little pills!! Great job. Thanks for the hard work Ryan & Co.
@vedovelli
@vedovelli 3 жыл бұрын
Remix brought up my lazy side, and now I just want to use the good old and let the browser do everything for me! 🙈
@benny-shen
@benny-shen 2 жыл бұрын
For latest version of Remix, you should code like this to stop TypeScript from complaining: let foo = useRef(null); let bar = useRef(null);
@Jan-fq2yp
@Jan-fq2yp 2 жыл бұрын
thanks
@nicolasrenon
@nicolasrenon Жыл бұрын
Thanks! Indeed, I was getting the error: Type 'MutableRefObject' is not assignable to type 'Ref | undefined'. Type 'MutableRefObject' is not assignable to type 'RefObject'. Types of property 'current' are incompatible. Type 'HTMLFormElement | undefined' is not assignable to type 'HTMLFormElement | null'. Type 'undefined' is not assignable to type 'HTMLFormElement | null'.ts(2322)
@Svish_
@Svish_ 3 жыл бұрын
Would `isAdding` turn `false` and clear out the form on cancellation as well? And if the request failed? Thinking that `useEffect` "flag" could become quite complicated quite quickly... 🤔
@noriller
@noriller 2 жыл бұрын
since we're using all the old, formal and proper things... instead of creating refs, any reason not to use document selector?
@acceledgy
@acceledgy 10 ай бұрын
You're awesome at explaining how to use Remix! Is there an updated version of this playlist for v2? Or is the method still the same for useEffect in v2?
@chriskruining
@chriskruining 3 жыл бұрын
looking forward to the optimistic UI, because I believe that would also "fix" the "issue" where on submission the form is reset and then the new entry get added, correct?
@DEV_XO
@DEV_XO 2 жыл бұрын
Amazing, thanks! ❤Remix.
@Jacobswain477
@Jacobswain477 2 жыл бұрын
Please do videos on best practices for resource routes + include examples of updating records and not just creating records.
@RichellyItalo
@RichellyItalo 2 жыл бұрын
Important: this will be removed for useNavigation in v2.
@abdelhameedhamdy
@abdelhameedhamdy 3 жыл бұрын
Like the short time demos
@shivamjhaa
@shivamjhaa 3 жыл бұрын
"Don't need state just to clear forms out"... and hit like
@mogadanez
@mogadanez 10 ай бұрын
If you have server side validation - you cant do it by isAdding flag.
@binarymystic
@binarymystic 10 ай бұрын
It's 2024 and this is the best way I've found to do this today: function Component() { const submit = useSubmit(); return ( { submit(event.currentTarget); event.currentTarget.reset(); event.preventDefault(); }} > {/* ... */} ); }
@brianwalsh7040
@brianwalsh7040 10 ай бұрын
thanks, was wondernig why it wasnt working for me
@kamertonaudiophileplayer847
@kamertonaudiophileplayer847 3 жыл бұрын
Wait, are you talking about SPA? Because all form fields are cleared automatically at a submission otherwise. As for SPA I do INNERHTML = '' , done, simple?
@JackRabbit-tg6hc
@JackRabbit-tg6hc 2 жыл бұрын
OMG how unconvenient. Feels like going back in time...
Remix Single: Concurrent Mutations w/ useFetcher
15:06
Remix
Рет қаралды 36 М.
Caching Data in Memory with Remix Client Loaders
9:15
Remix
Рет қаралды 11 М.
REAL or FAKE? #beatbox #tiktok
01:03
BeatboxJCOP
Рет қаралды 18 МЛН
How to treat Acne💉
00:31
ISSEI / いっせい
Рет қаралды 108 МЛН
Don’t Choose The Wrong Box 😱
00:41
Topper Guild
Рет қаралды 62 МЛН
JavaScript - How to Prevent a Form from Clearing Fields on Submit
4:46
Skillsoft YouTube
Рет қаралды 61 М.
No joke, I'm switching to remix after this bug
6:50
Web Dev Cody
Рет қаралды 27 М.
Writing Code That Runs FAST on a GPU
15:32
Low Level
Рет қаралды 585 М.
This is why useFormState and useFormStatus are important
8:46
Web Dev Cody
Рет қаралды 20 М.
How is this Website so fast!?
13:39
Wes Bos
Рет қаралды 1,4 МЛН
Remix Single: Multiple Forms and Single Button Mutations
10:43
Handling Complex Multiple Input Form States in React [2 LINES ONLY]
6:57
Learn React Hooks: useTransition - Simply Explained!
10:41
Cosden Solutions
Рет қаралды 33 М.
Prefetching Links in Remix
10:29
Remix
Рет қаралды 7 М.
The symptoms of bad code - Robert C. Martin (Uncle Bob)
5:42
Dev Tools Made Simple
Рет қаралды 35 М.
REAL or FAKE? #beatbox #tiktok
01:03
BeatboxJCOP
Рет қаралды 18 МЛН