👋 I'm Alex & I tweet about web dev stuff Creator of @trpcio, work @square, scout @a16z

Malmö, Sweden
Can anyone show me a use case of the `currentState`-argument in a server action when using `useFormState()`? I struggle to see why it exists.
9
2
56
52,069
Alex / KATT 🐱 retweeted
Made a Trellix clone using all the new React and Next.js primitives as well as some experimental stuff from tRPC. Check it out trellix-trpc.vercel.app
9
6
153
30,929
Replying to @vercel
It may sound like I'm complaining, I don't mean to, I have massive respect for everyone involved. 🫡 I am mainly super excited about what RSC and server actions enable -- isomorphic progressively enhanced websites have been a nerdy pipe dream of mine for over a decade and I've done many of my own pursuits that aren't nearly as good as what this can become
1
8
1,705
I do feel like the odd one out thinking about progressively enhanced forms when I see the APIs in React.. .. especially when form submits without JS enabled give a blank 405 page when deployed on @vercel itself github.com/vercel/next.js/is…
3
6
2,346
✅ No notion of "default state" when calling the hook ✅ No need to return input values in order to re-render `<input>`s values in SSR ✅ No two arguments on the server-side actions, there's only 1 - your input
2
8
1,611
nobody: me: I hacked together a POC of an alternative API to `useFormState()` / `useActionState()` that I think is nicer than what's in @reactjs / @nextjs today github.com/KATT/react-server…
I've made several attempts at trying to understand how to get `useFormState()`/`useActionState()` to work well isomorphically (which is the whole point, right!?). I made a repo to showcase the issues I have & added some API suggestions for React. Convince me I'm wrong. 🙏 👇
7
6
131
37,695
Agreed, I wouldn't have the tenacity do anything interesting without the ability of "cheating" a bit sometimes
can I say something without people getting mad? `any` is one of the best typescript features
1
8
3,386
well akckshuuaallly it's nifty to use `void` when dealing with fn arguments, sometimes nicer than `?: number` here if you're dealing with transforming fns using generics, this is very nice to know typescriptlang.org/play?#cod…
undefined / void (same thing)
1
1
20
5,470
a penny for your thoughts, @ryanflorence 🙏
3
1,173
Maybe actions should always do some kind of Post/Redirect/Get pattern (en.wikipedia.org/wiki/Post/R…) but then it won't work nicely when JS is enabled. Either I'm missing something obvious or @reactjs / @nextjs are missing something
2
3
1,915
I've made several attempts at trying to understand how to get `useFormState()`/`useActionState()` to work well isomorphically (which is the whole point, right!?). I made a repo to showcase the issues I have & added some API suggestions for React. Convince me I'm wrong. 🙏 👇
4
4
66
43,993
j/k, I'll leave that to the master @t3dotgg
1
14
2,266
Redis didn't stop being open source Obviously, I had to make a video about it Link below 👇
In the last 24 hours... - The US sued Apple - Redis stopped being open source - Github Copilot made a CLI Do I have to go live tonight?
3
60
30,782
Alex / KATT 🐱 retweeted
This describes my experience perfectly. RTFM, do a reproduction, and only then file an issue. I wanted to open issues and found out its my own fault while doing the reproduction a million times in the past. It's not that hard.
Replying to @ted_marozzi
At a certain size, 99% of issues filed are because they didn’t read the docs or they have some other unrelated thing messed up, so requiring a repro requires them to read the docs or see the package is working as expected and find their own problem, and then not file an issue.
3
4
83
13,163
Wdym @DavidKPiano, we only get fan mail and donor enquiries 😍😂
I don't think many developers realize how stressful being an open-source maintainer can be. You provide countless hours of work and support, for *free*. And devs will still complain and unfairly criticize your work. But the ones that are appreciative keep us going.
8
2
107
12,164
The European mind cannot comprehend this
Is this normal for restaurants these days?
22
85
25,818
The most exciting feature since template literal types 🍿
Oh, yeeeeah, this has been merged 😍😍😍😍😍😍😍😍😍 TS 5.5 is gonna be one of the most epic releases in a while, once again - huge props to @danvdk github.com/microsoft/TypeScr…
2
44
12,471
that's **not** how `<form [..]>` works when JS is enabled *
2
5
1,428
Note: with how it's designed today I don't really see how it helps people build forms that gracefully degrade/work without JS. One example being that a no-JS form will clear the inputs on every submission, but that's how a `<form action={action}>` works when JS is enabled
1
7
1,493